- 优化 SqlServer timestamp 行版本的支持;#1412

This commit is contained in:
2881099 2023-02-08 11:47:33 +08:00
parent f96ca81f0f
commit 0c82e810c2
2 changed files with 2 additions and 2 deletions

View File

@ -1144,7 +1144,7 @@ namespace FreeSql.Internal.CommonProvider
} }
} }
if (_versionColumn != null) if (_versionColumn != null && _versionColumn.Attribute.CanUpdate)
{ {
var vcname = _commonUtils.QuoteSqlName(_versionColumn.Attribute.Name); var vcname = _commonUtils.QuoteSqlName(_versionColumn.Attribute.Name);
if (_versionColumn.Attribute.MapType == typeof(byte[])) if (_versionColumn.Attribute.MapType == typeof(byte[]))

View File

@ -327,7 +327,7 @@ namespace FreeSql.Internal
} }
} }
if (colattr.MapType == typeof(string) && colattr.IsVersion == true) colattr.StringLength = 40; if (colattr.MapType == typeof(string) && colattr.IsVersion == true) colattr.StringLength = 40;
if (colattr.MapType == typeof(byte[]) && colattr.IsVersion == true) colattr.StringLength = 16; if (colattr.MapType == typeof(byte[]) && colattr.IsVersion == true) colattr.StringLength = 16; // 8=sqlserver timestamp, 16=GuidToBytes
if (colattr.MapType == typeof(byte[]) && colattr.StringLength != 0) if (colattr.MapType == typeof(byte[]) && colattr.StringLength != 0)
{ {
int strlen = colattr.StringLength; int strlen = colattr.StringLength;