且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

实体框架:将表拆分成多个表

更新时间:2023-02-13 15:59:20

在你的OnModelCreating中的上下文类:

In your Context class in OnModelCreating:

modelBuilder.Entity<GiftCouponPayment>()
                .Map(m =>
                {
                    m.MapInheritedProperties();
                    m.ToTable("GiftCouponPayment");
                });

modelBuilder.Entity<ClubCardPayment>()
                .Map(m =>
                {
                    m.MapInheritedProperties();
                    m.ToTable("ClubCardPayment");
                });