コード例 #1
0
 /// <summary>
 /// 预置字段
 /// </summary>
 /// <param name="metaObjectId"></param>
 public void PresetFields(int metaObjectId)
 {
     dbContext.Add <MetaField>(new List <MetaField> {
         new MetaField {
             MetaObjectId = metaObjectId,
             Code         = "_id",
             Name         = "数据ID",
             Description  = "系统字段",
             IsSystem     = (int)TrueFalse.True,
             FieldType    = (int)DataType.Text,
             SortNumber   = -1
         },
         new MetaField {
             MetaObjectId = metaObjectId,
             Code         = "IsDeleted",
             Name         = "是否删除",
             Description  = "系统字段",
             IsSystem     = (int)TrueFalse.True,
             FieldType    = (int)DataType.Boolean,
             SortNumber   = -1
         },
         new MetaField {
             MetaObjectId = metaObjectId,
             Code         = "CreateBy",
             Name         = "创建人",
             Description  = "系统字段",
             IsSystem     = (int)TrueFalse.True,
             FieldType    = (int)DataType.Int,
             SortNumber   = -1
         },
         new MetaField {
             MetaObjectId = metaObjectId,
             Code         = "CreateTime",
             Name         = "创建时间",
             Description  = "系统字段",
             IsSystem     = (int)TrueFalse.True,
             FieldType    = (int)DataType.DateTime,
             SortNumber   = -1
         },
         new MetaField {
             MetaObjectId = metaObjectId,
             Code         = "ModifyBy",
             Name         = "修改人",
             Description  = "系统字段",
             IsSystem     = (int)TrueFalse.True,
             FieldType    = (int)DataType.Int,
             SortNumber   = -1
         },
         new MetaField {
             MetaObjectId = metaObjectId,
             Code         = "ModifyTime",
             Name         = "修改时间",
             Description  = "系统字段",
             IsSystem     = (int)TrueFalse.True,
             FieldType    = (int)DataType.DateTime,
             SortNumber   = -1
         }
     });
 }
コード例 #2
0
 public ResultModel Add(TEntity entity)
 {
     dbContext.Add(entity);
     return(ResultModel.Success());
 }
コード例 #3
0
 public Result <TEntity> Add(TEntity entity)
 {
     dbContext.Add(entity);
     return(Result <TEntity> .Success());
 }