愚人节版本

This commit is contained in:
28810 2019-04-01 12:17:59 +08:00
parent be5259dd68
commit da1c6cd4f0
3 changed files with 32 additions and 9 deletions

View File

@ -55,5 +55,12 @@
_column.IsIgnore = value; _column.IsIgnore = value;
return this; return this;
} }
/// <summary>
/// 乐观锁
/// </summary>
public ColumnFluent IsVersion(bool value) {
_column.IsVersion = value;
return this;
}
} }
} }

View File

@ -53,6 +53,7 @@ namespace FreeSql.Extensions.EntityUtil {
}.Where(c => c != null).ToArray() }.Where(c => c != null).ToArray()
); );
} }
if (pks[a].Attribute.IsIdentity || isguid || pks[a].CsType == typeof(string) || pks[a].CsType.IsNullableType()) {
exps.Add( exps.Add(
Expression.IfThen( Expression.IfThen(
Expression.IsFalse(var3IsNull), Expression.IsFalse(var3IsNull),
@ -70,6 +71,21 @@ namespace FreeSql.Extensions.EntityUtil {
) )
) )
); );
} else {
exps.Add(
Expression.IfThen(
Expression.IsFalse(var3IsNull),
Expression.Block(
new Expression[]{
a > 0 ? Expression.Call(var2Sb, MethodStringBuilderAppend, Expression.Constant(splitString)) : null,
Expression.Call(var2Sb, MethodStringBuilderAppend,
Expression.Convert(Expression.MakeMemberAccess(var1Parm, _table.Properties[pks[a].CsName]), typeof(object))
)
}.Where(c => c != null).ToArray()
)
)
);
}
} }
exps.Add( exps.Add(
Expression.IfThen( Expression.IfThen(

View File

@ -4,7 +4,7 @@ FreeSql 是一个功能强大的 .NETStandard 库,用于对象关系映射程
|--------------| ------- | ---- | |--------------| ------- | ---- |
| FreeSql | [![nuget](https://img.shields.io/nuget/v/FreeSql.svg?style=flat-square)](https://www.nuget.org/packages/FreeSql) | [![stats](https://img.shields.io/nuget/dt/FreeSql.svg?style=flat-square)](https://www.nuget.org/stats/packages/FreeSql?groupby=Version) | | FreeSql | [![nuget](https://img.shields.io/nuget/v/FreeSql.svg?style=flat-square)](https://www.nuget.org/packages/FreeSql) | [![stats](https://img.shields.io/nuget/dt/FreeSql.svg?style=flat-square)](https://www.nuget.org/stats/packages/FreeSql?groupby=Version) |
| [FreeSql.Repository](https://github.com/2881099/FreeSql/wiki/Repository) | [![nuget](https://img.shields.io/nuget/v/FreeSql.Repository.svg?style=flat-square)](https://www.nuget.org/packages/FreeSql.Repository) | [![stats](https://img.shields.io/nuget/dt/FreeSql.Repository.svg?style=flat-square)](https://www.nuget.org/stats/packages/FreeSql.Repository?groupby=Version) | | [FreeSql.Repository](https://github.com/2881099/FreeSql/wiki/Repository) | [![nuget](https://img.shields.io/nuget/v/FreeSql.Repository.svg?style=flat-square)](https://www.nuget.org/packages/FreeSql.Repository) | [![stats](https://img.shields.io/nuget/dt/FreeSql.Repository.svg?style=flat-square)](https://www.nuget.org/stats/packages/FreeSql.Repository?groupby=Version) |
| [FreeSql.DbContext](https://github.com/2881099/FreeSql/wiki/DbContext) | [![nuget](https://img.shields.io/nuget/v/FreeSql.DbContext.svg?style=flat-square)](https://www.nuget.org/packages/FreeSql.DbContext) | [![stats](https://img.shields.io/nuget/dt/FreeSql.DbContext.svg?style=flat-square)](https://www.nuget.org/stats/packages/FreeSql.DbContext?groupby=Version) | | [FreeSql.DbContext](https://github.com/2881099/FreeSql.DbContext) | [![nuget](https://img.shields.io/nuget/v/FreeSql.DbContext.svg?style=flat-square)](https://www.nuget.org/packages/FreeSql.DbContext) | [![stats](https://img.shields.io/nuget/dt/FreeSql.DbContext.svg?style=flat-square)](https://www.nuget.org/stats/packages/FreeSql.DbContext?groupby=Version) |
# 特性 # 特性