LANCommander/LANCommander.Server.Data/Models/Role.cs

33 lines
936 B
C#
Raw Permalink Normal View History

using Microsoft.AspNetCore.Identity;
2024-10-15 23:48:16 -05:00
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
2024-08-04 18:44:33 -05:00
namespace LANCommander.Server.Data.Models
{
[Table("Roles")]
2024-10-15 23:48:16 -05:00
public class Role : IdentityRole<Guid>, IBaseModel
{
2024-11-27 01:51:47 -06:00
public ICollection<Collection> Collections { get; set; }
2024-10-16 16:29:55 -05:00
[NotMapped]
2024-11-27 01:51:47 -06:00
public ICollection<User> Users { get; set; }
2024-10-15 23:48:16 -05:00
[Display(Name = "Created On")]
public DateTime CreatedOn { get; set; }
public Guid? CreatedById { get; set; }
[ForeignKey(nameof(CreatedById))]
2024-10-15 23:48:16 -05:00
[Display(Name = "Created By")]
2024-11-27 01:51:47 -06:00
public User? CreatedBy { get; set; }
2024-10-15 23:48:16 -05:00
[Display(Name = "Updated On")]
public DateTime UpdatedOn { get; set; }
public Guid? UpdatedById { get; set; }
[ForeignKey(nameof(UpdatedById))]
2024-10-15 23:48:16 -05:00
[Display(Name = "Updated By")]
2024-11-27 01:51:47 -06:00
public User? UpdatedBy { get; set; }
}
}