mirror of
https://github.com/nsnail/FreeSql.git
synced 2025-04-22 10:42:52 +08:00
Merge pull request #724 from jianxuanbing/master
fix: 修复byte[]类型的乐观锁初始化问题
This commit is contained in:
commit
847cc7838c
@ -179,7 +179,7 @@ namespace FreeSql.Internal.CommonProvider
|
||||
}
|
||||
if (val == null && col.Attribute.MapType == typeof(string) && col.Attribute.IsNullable == false)
|
||||
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()));
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user