DD.WellWorkover.Cloud/AsbCloudDb/Model/UserRole.cs

33 lines
1.3 KiB
C#
Raw Normal View History

using Microsoft.EntityFrameworkCore;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace AsbCloudDb.Model
{
[Table("t_user_role"), Comment("Роли пользователей в системе")]
2021-04-07 18:01:56 +05:00
public class UserRole : IId
{
[Key]
[Column("id")]
public int Id { get; set; }
[Column("caption"), Comment("Название")]
2023-02-20 12:18:45 +05:00
[StringLength(255, MinimumLength = 2)]
public string Caption { get; set; } = null!;
[Column("id_type"), Comment("0-роль из стандартной матрицы, \n1-специальная роль для какого-либо пользователя")]
public int IdType { get; set; }
2022-04-11 18:00:34 +05:00
[InverseProperty(nameof(RelationUserRoleUserRole.Role))]
2023-02-20 12:18:45 +05:00
public virtual ICollection<RelationUserRoleUserRole> RelationUserRoleUserRoles { get; set; } = null!;
[InverseProperty(nameof(RelationUserUserRole.UserRole))]
2023-02-20 12:18:45 +05:00
public virtual ICollection<RelationUserUserRole> RelationUsersUserRoles { get; set; } = null!;
2022-04-11 18:00:34 +05:00
[InverseProperty(nameof(RelationUserRolePermission.UserRole))]
2023-02-20 12:18:45 +05:00
public virtual ICollection<RelationUserRolePermission> RelationUserRolePermissions { get; set; } = null!;
}
}