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

 

转载于:https://www.cnblogs.com/stooges/p/5023756.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值