- 增加 EfCoreFluentApi 扩展包,接近 efcore fluentApi 的使用习惯;#4

- 增加 ColumnAttribute 属性 InsertValueSql,插入数据的时候指定用 sql 值;
This commit is contained in:
28810
2019-12-29 15:30:43 +08:00
parent 20ffad0ba3
commit 8cb7ef2130
14 changed files with 721 additions and 163 deletions

View File

@ -191,6 +191,11 @@ namespace FreeSql.Internal
col.DbDefaultValue = colattr.ServerTime == DateTimeKind.Local ? common.Now : common.NowUtc;
col.DbInsertValue = colattr.ServerTime == DateTimeKind.Local ? common.Now : common.NowUtc;
}
if (string.IsNullOrEmpty(colattr.InsertValueSql) == false)
{
col.DbDefaultValue = colattr.InsertValueSql;
col.DbInsertValue = colattr.InsertValueSql;
}
if (colattr.MapType == typeof(string) && colattr.StringLength != 0)
{
int strlen = colattr.StringLength;