forked from ddrilling/AsbCloudServer
28 lines
880 B
C#
28 lines
880 B
C#
using Microsoft.EntityFrameworkCore;
|
|
using System.ComponentModel.DataAnnotations.Schema;
|
|
using System.ComponentModel.DataAnnotations;
|
|
|
|
namespace AsbCloudDb.Model
|
|
{
|
|
[Table("t_relation_user_user_role"), Comment("Отношение пользователей и ролей")]
|
|
public class RelationUserUserRole
|
|
{
|
|
[Key]
|
|
[Column("id")]
|
|
public int Id { get; set; }
|
|
|
|
[Column("id_user")]
|
|
public int IdUser { get; set; }
|
|
|
|
[Column("id_user_role")]
|
|
public int IdUserRole { get; set; }
|
|
|
|
[ForeignKey(nameof(IdUser))]
|
|
[InverseProperty(nameof(Model.User.RelationUsersUserRoles))]
|
|
public virtual User User { get; set; }
|
|
|
|
[ForeignKey(nameof(IdUserRole))]
|
|
[InverseProperty(nameof(Model.UserRole.RelationUsersUserRoles))]
|
|
public virtual UserRole UserRole { get; set; }
|
|
}
|
|
} |