using Easy.DDD.Domain.Entities;
namespace Identity.Api.Clean.Domain.Entites;
///
/// 表示用户和角色之间的链接。
///
public class IdentityUserRole : Entity
{
public virtual Guid? TenantId { get; protected set; }
///
/// 获取或设置链接到角色的用户的主键。
///
public virtual Guid UserId { get; protected set; }
public virtual IdentityUser User { get; protected set; }
///
/// 获取或设置链接到用户的角色的主键。
///
public virtual Guid RoleId { get; protected set; }
public virtual IdentityRole Role { get; protected set; }
///
/// 创建时间
///
public virtual DateTime CreationTime { get; protected set; }
public IdentityUserRole()
{
}
protected internal IdentityUserRole(Guid userId, Guid roleId, Guid? tenantId)
{
UserId = userId;
RoleId = roleId;
TenantId = tenantId;
CreationTime = DateTime.Now;
}
}