可以实现 required members 支持嘛 返回

SqlSugar 老数据
7 1043
该叫什么 Bone 发布于2023/1/30
悬赏:5 飞吻

image.pngimage.png

热忱回答(7)

  • fate sta fate sta VIP0
    2023/1/30

    mvcentity 这个类发一下

    0 回复
  • fate sta fate sta VIP0
    2023/1/30

    目前是这个类没办法new报错

    0 回复
  • Bone Bone VIP0
    2023/1/30
    using Bone.Solomon.Olympus.Enums;
    using SqlSugar;
    
    namespace Bone.Solomon.Olympus.Entities;
    
    [SugarTable("mvp")]
    public class MvpEntity
    {
        [SugarColumn(ColumnName = "id", IsPrimaryKey = true, IsIdentity = true)]
        public int Id { get; set; }
    
        [SugarColumn(ColumnName = "steam")]
        public int Steam { get; set; }
    
        [SugarColumn(ColumnName = "name")]
        public required string Name { get; set; }
    
        [SugarColumn(ColumnName = "file")]
        public required string File { get; set; }
    
        [SugarColumn(ColumnName = "status")]
        public AuditStatus Status { get; set; }
    
        [SugarColumn(ColumnName = "created_at", IsOnlyIgnoreInsert = true, IsOnlyIgnoreUpdate = true)]
        public DateTime CreatedAt { get; set; }
    
        [SugarColumn(ColumnName = "updated_at", IsOnlyIgnoreInsert = true, IsOnlyIgnoreUpdate = true)]
        public DateTime UpdatedAt { get; set; }
    }


    0 回复
  • Bone Bone VIP0
    2023/1/30

    @fate sta:是的 用到了required关键字 所以不能new 不知道有没有可能有办法用上required关键字

    0 回复
  • Bone Bone VIP0
    2023/1/30
    namespace Bone.Solomon.Olympus.Enums;
    
    public enum AuditStatus
    {
        Pending,
        Approved,
        Reject
    }


    0 回复
  • fate sta fate sta VIP0
    2023/1/30

    暂时不支持

    0 回复
  • Bone Bone VIP0
    2023/1/30

    @fate sta:好

    0 回复