public void Configure(EfCoreTableFluent <Song> eb) { eb.ToTable("tb_song_config"); eb.Ignore(a => a.Field1); eb.Property(a => a.Title).HasColumnType("varchar(50)").IsRequired(); eb.Property(a => a.Url).HasMaxLength(100); eb.Property(a => a.RowVersion).IsRowVersion(); eb.Property(a => a.CreateTime).HasDefaultValueSql("current_timestamp"); eb.HasKey(a => a.Id); eb.HasIndex(a => a.Title).IsUnique().HasName("idx_tb_song1111"); //一对多、多对一 eb.HasOne(a => a.Type).HasForeignKey(a => a.TypeId).WithMany(a => a.Songs); //多对多 eb.HasMany(a => a.Tags).WithMany(a => a.Songs, typeof(Song_tag)); }
/// <summary> /// 映射表 /// </summary> protected override void MapTable( EfCoreTableFluent<User> builder ) { builder.ToTable( "`Systems.User`" ); }
/// <summary> /// 映射表 /// </summary> protected override void MapTable(EfCoreTableFluent <Role> builder) { builder.ToTable("`Systems.Role`"); }
/// <summary> /// 映射表 /// </summary> protected override void MapTable(EfCoreTableFluent <UserInfo> builder) { builder.ToTable("`Commons.UserInfo`"); }
/// <summary> /// 映射表 /// </summary> protected override void MapTable(EfCoreTableFluent <Permission> builder) { builder.ToTable("`Systems.Permission`"); }
/// <summary> /// 映射表 /// </summary> protected override void MapTable(EfCoreTableFluent <Dictionary> builder) { builder.ToTable("`Commons.Dictionary`"); }
/// <summary> /// 映射表 /// </summary> protected override void MapTable(EfCoreTableFluent <Area> builder) { builder.ToTable("`Commons.Area`"); }
/// <summary> /// 映射表 /// </summary> protected override void MapTable(EfCoreTableFluent <ResourcePo> builder) { builder.ToTable("`Systems.Resource`"); }
/// <summary> /// 映射表 /// </summary> protected override void MapTable(EfCoreTableFluent <Administrator> builder) { builder.ToTable("`Systems.Administrator`"); }
/// <summary> /// 映射表 /// </summary> protected override void MapTable(EfCoreTableFluent <ApplicationPo> builder) { builder.ToTable("`Systems.Application`"); }
/// <summary> /// 映射表 /// </summary> protected override void MapTable(EfCoreTableFluent <File> builder) { builder.ToTable("`Commons.File`"); }