mirror of
https://github.com/nsnail/FreeSql.git
synced 2025-04-22 02:32:50 +08:00
v0.4.5(清明版本)
- 优化 IFreeSql.Transaction 可嵌套连续使用,之前会死锁; - 修复 导航属性的关系,误将 ManyToOne 设置成了 OneToMany; - 补充 DbFirst GetTablesByDatabase 获取表备注; - 补充 ISelect.ToList(a => new XxxDto { XxxId = a.Id, ... }) 支持,之前只能支持匿名类; - 补充 扩展 IUpdate.Set(a => a.Title + "111") 指定字段在原基础上增加值的范围,之前只支持数字类型的累加;
This commit is contained in:
parent
66cacaed88
commit
69909fdb8a
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>netstandard2.0</TargetFramework>
|
<TargetFramework>netstandard2.0</TargetFramework>
|
||||||
<Version>0.4.1.2</Version>
|
<Version>0.4.5</Version>
|
||||||
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
|
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
|
||||||
<Authors>YeXiangQin</Authors>
|
<Authors>YeXiangQin</Authors>
|
||||||
<Description>FreeSql is the most convenient ORM in dotnet. It supports Mysql, Postgresql, SqlServer, Oracle and Sqlite.</Description>
|
<Description>FreeSql is the most convenient ORM in dotnet. It supports Mysql, Postgresql, SqlServer, Oracle and Sqlite.</Description>
|
||||||
|
@ -285,12 +285,13 @@ namespace FreeSql.Internal.CommonProvider {
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
public IUpdate<T1> Set<TMember>(Expression<Func<T1, TMember>> binaryExpression) {
|
public IUpdate<T1> Set<TMember>(Expression<Func<T1, TMember>> binaryExpression) {
|
||||||
if (binaryExpression?.Body is BinaryExpression == false) return this;
|
if (binaryExpression?.Body is BinaryExpression == false &&
|
||||||
|
binaryExpression?.Body.NodeType != ExpressionType.Call) return this;
|
||||||
var cols = new List<SelectColumnInfo>();
|
var cols = new List<SelectColumnInfo>();
|
||||||
var expt = _commonExpression.ExpressionWhereLambdaNoneForeignObject(null, cols, binaryExpression, null);
|
var expt = _commonExpression.ExpressionWhereLambdaNoneForeignObject(null, cols, binaryExpression, null);
|
||||||
if (cols.Any() == false) return this;
|
if (cols.Any() == false) return this;
|
||||||
foreach (var col in cols) {
|
foreach (var col in cols) {
|
||||||
if (col.Column.Attribute.IsNullable == true) {
|
if (col.Column.Attribute.IsNullable == true && col.Column.CsType.IsNullableType()) {
|
||||||
var replval = _orm.CodeFirst.GetDbInfo(col.Column.CsType.GenericTypeArguments.FirstOrDefault())?.defaultValue;
|
var replval = _orm.CodeFirst.GetDbInfo(col.Column.CsType.GenericTypeArguments.FirstOrDefault())?.defaultValue;
|
||||||
if (replval == null) continue;
|
if (replval == null) continue;
|
||||||
var replname = _commonUtils.QuoteSqlName(col.Column.Attribute.Name);
|
var replname = _commonUtils.QuoteSqlName(col.Column.Attribute.Name);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user