using ModelTools.Attributes;
using ModelTools.Enums;
using ModelTools.ViewModels;
using System;
namespace SecurityBusinessLogic.ViewModels
{
///
/// Список достпуов
///
public class AccessListViewModel : ListViewModel { }
///
/// Элемент доступа
///
public class AccessViewModel : ElementViewModel
{
[MapConfiguration("RoleId")]
public Guid RoleId { get; set; }
[ViewModelOnListProperty("Роль", 100)]
[MapConfiguration("Role.RoleName", true)]
public string RoleName { get; set; }
[MapConfiguration("AccessOperation")]
public AccessOperation AccessOperation { get; set; }
[ViewModelOnListProperty("Операция")]
public string AccessOperationTitle => AccessOperation.ToString("G");
[MapConfiguration("AccessType")]
public AccessType AccessType { get; set; }
[ViewModelOnListProperty("Тип", 150)]
public string AccessTypeTitle => AccessType.ToString("G");
public override string ToString() => $"{RoleName}-{AccessOperationTitle}({AccessTypeTitle})";
}
}