LANCommander/LANCommander.Server.Data/Models/Role.cs
2024-11-27 01:51:47 -06:00

32 lines
936 B
C#

using Microsoft.AspNetCore.Identity;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace LANCommander.Server.Data.Models
{
[Table("Roles")]
public class Role : IdentityRole<Guid>, IBaseModel
{
public ICollection<Collection> Collections { get; set; }
[NotMapped]
public ICollection<User> Users { get; set; }
[Display(Name = "Created On")]
public DateTime CreatedOn { get; set; }
public Guid? CreatedById { get; set; }
[ForeignKey(nameof(CreatedById))]
[Display(Name = "Created By")]
public User? CreatedBy { get; set; }
[Display(Name = "Updated On")]
public DateTime UpdatedOn { get; set; }
public Guid? UpdatedById { get; set; }
[ForeignKey(nameof(UpdatedById))]
[Display(Name = "Updated By")]
public User? UpdatedBy { get; set; }
}
}