detect/detect.gui/Models/Entities/AuthorityEntity.cs

29 lines
829 B
C#
Raw Normal View History

2024-11-13 17:09:15 +08:00
using System;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using Avalonia.Collections;
using Microsoft.EntityFrameworkCore;
using Newtonsoft.Json;
namespace detect.gui.Models.Entities;
[Table("Authority")]
[Index(nameof(Name), IsUnique = true)]
[Index(nameof(ParentId), IsUnique = false)]
public class AuthorityEntity
{
[Key] public long? Id { get; set; }
[StringLength(255), Comment("名称")] public string? Name { get; set; }
[DefaultValue(0)] public long? ParentId { get; set; }
[Comment("创建时间")] public DateTime? CreateTime { get; set; }
[Comment("更新时间")] public DateTime? UpdateTime { get; set; }
[NotMapped]
[JsonIgnore]
public AvaloniaList<AuthorityEntity>? Children { get; set; }
}