• EFDB 基本规范&知识


      

      public abstract class AccountRole //这是继承类型
        {
            [Key]
            public int ID { get; set; }
            public bool isDisabled { get; set; }
            public string email { get; set; }
            public string remark { get; set; }
            public string firstName { get; set; }
            public string lastName { get; set; }
            public string taskss { get; set; }
    
            [ForeignKey("account")]
            public int Accounts_id { get; set; }
            public virtual Account account { get; set; }
    
            [DatabaseGenerated(DatabaseGeneratedOption.Computed)]
            public DateTimeOffset rowCreatedDT { get; set; }
            [DatabaseGenerated(DatabaseGeneratedOption.Computed)]
            [ConcurrencyCheck]
            public byte[] rowVersion { get; set; }
            [ForeignKey("rowCreator")]
            public int? rowCreatorLoginAccounts_ID { get; set; }
            [ForeignKey("rowLastModifiedBy")]
            public int? rowLastModifiedByLoginAccounts_ID { get; set; }
    
            public virtual LoginAccount rowCreator { get; set; }
            public virtual LoginAccount rowLastModifiedBy { get; set; }
        }public class MemberRole : AccountRole //memberROle 继承 accountROle
        {
            public MemberRole()
            {
                businessResultComplex = new BusinessResultComplex { };
                monthlyTaskComplex = new MonthlyTaskComplex { };
            }
            public string investorOrIB { get; set; }
            public string MT4ID { get; set; }
            public string fullName { get; set; }
            public DateTime dateOfBirth { get; set; }
            public string alternativeEmail { get; set; }
            public string contactNumber { get; set; }
            public string gender { get; set; } 
            public BeneficiaryComplex beneficiaryComplex { get; set; } //complex 类型
            public AddressComplex addressComplex { get; set; }
            public BankComplex bankComplex { get; set; }
            public BusinessResultComplex businessResultComplex { get; set; }
            public MonthlyTaskComplex monthlyTaskComplex { get; set; }
            public DateTimeOffset lastLoginDT { get; set; }  //dateTime原始类型
            public DateTime TTDate { get; set; } //date原始类型
                    
            [ForeignKey("currentLevel")]
            public int Levels_ID { get; set; }
               
            public MemberMLMRelationTree MLMRelationTree { get; set; } 
            public BankBalance bankBalance { get; set; }
            public Level currentLevel { get; set; }
    
            public List<HistoryLogin> historyLogins { get; set; }
            public List<HistoryBankTransaction> historyBankTransactions { get; set; }         
            public List<HistoryLevel> historyLevels { get; set; }
            public List<Withdrawal> withdrawals { get; set; } 
            public List<MemberContract> contracts { get; set; }
        }
      public class HistoryLogin : RowInfo
        {
            [Key]
            public int ID { get; set; }
    
            [ForeignKey("member")]
            public int Members_ID { get; set; }
    
            public MemberRole member { get; set; }
        }

    EFDB是sql的结构, 大家都是类型(class), 但是有些时候会有大量重复, 所以会有继承(abstract)

    原始类型有 string, int, datetime, date

    在类型里可以有其他类型, 如果类型是complex就是一种集合(规范) , list(这是多对多或一对多的关系) , enum

  • 相关阅读:
    sqlserver服务 正在挂起更改,导致无法打开或者停止服务
    menuStrip与toolStrip的使用
    sqlDataCommandBuilder为dataGridView自动生成增删改代码时报错
    visual studio属性面板解释文字看不见
    窗体句柄 控件句柄
    form窗体show不出来
    TextBox密码框变文本框,文本框变密码框
    DataSet数据集手动添加一行记录
    Anaconda3-更换为清华源后依旧报错CondaHTTPError: HTTP 000 CONNECTION FAILED
    Kali Linux 国内源
  • 原文地址:https://www.cnblogs.com/stooges/p/5023756.html
Copyright © 2020-2023  润新知