mirror of
https://github.com/nsnail/FreeSql.git
synced 2025-04-22 02:32:50 +08:00
fix: 修复byte[]类型的乐观锁初始化问题
This commit is contained in:
parent
cad97b37ba
commit
b6b9281f71
@ -179,7 +179,7 @@ namespace FreeSql.Internal.CommonProvider
|
|||||||
}
|
}
|
||||||
if (val == null && col.Attribute.MapType == typeof(string) && col.Attribute.IsNullable == false)
|
if (val == null && col.Attribute.MapType == typeof(string) && col.Attribute.IsNullable == false)
|
||||||
col.SetValue(data, val = "");
|
col.SetValue(data, val = "");
|
||||||
if (val == null && col.Attribute.MapType == typeof(byte[]) && col.Attribute.IsVersion)
|
if (col.Attribute.MapType == typeof(byte[]) && (val == null || (val is byte[] bytes && bytes.Length == 0)) && col.Attribute.IsVersion)
|
||||||
col.SetValue(data, val = Utils.GuidToBytes(Guid.NewGuid()));
|
col.SetValue(data, val = Utils.GuidToBytes(Guid.NewGuid()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user