예제 #1
0
 /// <summary>
 /// 映射属性
 /// </summary>
 protected override void MapProperties(EfCoreTableFluent <Area> builder)
 {
     // 地区编号
     builder.Property(t => t.Id)
     .HasColumnName("AreaId");
     builder.Property(t => t.Path).HasColumnName("Path");
     builder.Property(t => t.Level).HasColumnName("Level");
 }
예제 #2
0
 /// <summary>
 /// 映射属性
 /// </summary>
 protected override void MapProperties(EfCoreTableFluent <Role> builder)
 {
     // 角色标识
     builder.Property(t => t.Id)
     .HasColumnName("RoleId");
     builder.Property(t => t.Path).HasColumnName("Path");
     builder.Property(t => t.Level).HasColumnName("Level");
 }
예제 #3
0
 /// <summary>
 /// 映射属性
 /// </summary>
 protected override void MapProperties(EfCoreTableFluent <Dictionary> builder)
 {
     // 字典编号
     builder.Property(t => t.Id)
     .HasColumnName("DictionaryId");
     builder.Property(t => t.Path).HasColumnName("Path");
     builder.Property(t => t.Level).HasColumnName("Level");
 }
예제 #4
0
        public void ApplyConfiguration <T>(EfCoreTableFluent <T> ex)
        {
            object o = Activator.CreateInstance(type);

            type.GetMethod("Configure")?.Invoke(o, new object[1] {
                ex
            });
        }
예제 #5
0
    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));
    }
예제 #6
0
 /// <summary>
 /// 映射表
 /// </summary>
 protected override void MapTable(EfCoreTableFluent <Dictionary> builder)
 {
     builder.ToTable("`Commons.Dictionary`");
 }
예제 #7
0
 /// <summary>
 /// 映射导航属性
 /// </summary>
 /// <param name="builder">实体类型生成器</param>
 protected virtual void MapAssociations(EfCoreTableFluent <TEntity> builder)
 {
 }
예제 #8
0
 /// <summary>
 /// 映射属性
 /// </summary>
 /// <param name="builder">实体类型生成器</param>
 protected virtual void MapProperties(EfCoreTableFluent <TEntity> builder)
 {
 }
예제 #9
0
 /// <summary>
 /// 映射属性
 /// </summary>
 protected override void MapProperties(EfCoreTableFluent <File> builder)
 {
     // 文件编号
     builder.Property(t => t.Id)
     .HasColumnName("FileId");
 }
예제 #10
0
 /// <summary>
 /// 映射表
 /// </summary>
 protected override void MapTable(EfCoreTableFluent <ApplicationPo> builder)
 {
     builder.ToTable("`Systems.Application`");
 }
예제 #11
0
 /// <summary>
 /// 映射属性
 /// </summary>
 protected override void MapProperties(EfCoreTableFluent <Permission> builder)
 {
     // 权限标识
     builder.Property(t => t.Id)
     .HasColumnName("PermissionId");
 }
예제 #12
0
 /// <summary>
 /// 映射属性
 /// </summary>
 protected override void MapProperties(EfCoreTableFluent <UserLoginLog> builder)
 {
     // 用户登录日志编号
     builder.Property(t => t.Id)
     .HasColumnName("UserLoginLogId");
 }
예제 #13
0
 /// <summary>
 /// 映射属性
 /// </summary>
 protected override void MapProperties(EfCoreTableFluent <UserRole> builder)
 {
     // 复合标识
     builder.HasKey(t => new { t.UserId, t.RoleId });
 }
예제 #14
0
 /// <summary>
 /// 映射表
 /// </summary>
 protected override void MapTable(EfCoreTableFluent <ResourcePo> builder)
 {
     builder.ToTable("`Systems.Resource`");
 }
예제 #15
0
 /// <summary>
 /// 映射属性
 /// </summary>
 protected override void MapProperties(EfCoreTableFluent <Administrator> builder)
 {
     // 管理员编号
     builder.Property(t => t.Id)
     .HasColumnName("AdministratorId");
 }
예제 #16
0
 /// <summary>
 /// 映射表
 /// </summary>
 protected override void MapTable(EfCoreTableFluent <Administrator> builder)
 {
     builder.ToTable("`Systems.Administrator`");
 }
예제 #17
0
 /// <summary>
 /// 映射属性
 /// </summary>
 protected override void MapProperties(EfCoreTableFluent <ApplicationPo> builder)
 {
     // 应用程序标识
     builder.Property(t => t.Id)
     .HasColumnName("ApplicationId");
 }
예제 #18
0
 /// <summary>
 /// 映射表
 /// </summary>
 protected override void MapTable(EfCoreTableFluent <Area> builder)
 {
     builder.ToTable("`Commons.Area`");
 }
예제 #19
0
 /// <summary>
 /// 映射表
 /// </summary>
 protected override void MapTable(EfCoreTableFluent <Role> builder)
 {
     builder.ToTable("`Systems.Role`");
 }
예제 #20
0
 /// <summary>
 /// 映射表
 /// </summary>
 protected override void MapTable(EfCoreTableFluent <Permission> builder)
 {
     builder.ToTable("`Systems.Permission`");
 }
예제 #21
0
 /// <summary>
 /// 映射表
 /// </summary>
 protected override void MapTable( EfCoreTableFluent<User> builder ) 
 {
     builder.ToTable( "`Systems.User`" );
 }
예제 #22
0
 /// <summary>
 /// 映射表
 /// </summary>
 protected override void MapTable(EfCoreTableFluent <UserInfo> builder)
 {
     builder.ToTable("`Commons.UserInfo`");
 }
예제 #23
0
 /// <summary>
 /// 映射乐观离线锁
 /// </summary>
 /// <param name="builder">实体类型生成器</param>
 protected override void MapVersion(EfCoreTableFluent <TEntity> builder) => builder.Property(x => x.Version).IsRowVersion();
예제 #24
0
 /// <summary>
 /// 映射表
 /// </summary>
 /// <param name="builder">实体模型生成器</param>
 protected abstract void MapTable(EfCoreTableFluent <TEntity> builder);
예제 #25
0
 /// <summary>
 /// 映射乐观离线锁
 /// </summary>
 /// <param name="builder">实体类型生成器</param>
 protected virtual void MapVersion(EfCoreTableFluent <TEntity> builder)
 {
 }
예제 #26
0
 /// <summary>
 /// 映射属性
 /// </summary>
 protected override void MapProperties( EfCoreTableFluent<User> builder ) 
 {
     // 用户标识
     builder.Property(t => t.Id)
         .HasColumnName("UserId");
 }
예제 #27
0
 /// <summary>
 /// 映射表
 /// </summary>
 protected override void MapTable(EfCoreTableFluent <File> builder)
 {
     builder.ToTable("`Commons.File`");
 }