lwl1569  
  1. 初始化数据
        protected override void OnModelCreating(ModelBuilder modelBuilder)
        {
            modelBuilder.Entity<ModelA>().HasData(param[] ModelA);//HasData括号内为添加的数据。ModelA是Model对象
            modelBuilder.Entity<ModelB>().HasData(param[] ModelB);//HasData括号内为添加的数据。ModelB是Model对象
            base.OnModelCreating(modelBuilder);
        }
  1. 定义FluentAPI
    参考https://www.cnblogs.com/seekdream/p/10641510.html
posted on 2021-09-03 16:07  lwl1569  阅读(24)  评论(0编辑  收藏  举报