mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-04-29 01:47:06 +08:00
Modify validation logic
This commit is contained in:
parent
fb2eeaf171
commit
9a45e0cfe6
@ -620,21 +620,21 @@ namespace SqlSugar
|
||||
Check.Exception(dbVersion == null, "UpdateVersionValidation database column {0} is not null", versionColumn.DbColumnName);
|
||||
if (versionColumn.PropertyInfo.PropertyType.IsIn(UtilConstants.IntType, UtilConstants.LongType))
|
||||
{
|
||||
if (Convert.ToInt64(dbVersion) > Convert.ToInt64(currentVersion))
|
||||
if (Convert.ToInt64(dbVersion) != Convert.ToInt64(currentVersion))
|
||||
{
|
||||
throw new VersionExceptions(string.Format("UpdateVersionValidation {0} Not the latest version ", versionColumn.PropertyName));
|
||||
}
|
||||
}
|
||||
else if (versionColumn.PropertyInfo.PropertyType.IsIn(UtilConstants.DateType))
|
||||
{
|
||||
if (dbVersion.ObjToDate() > currentVersion.ObjToDate())
|
||||
if (dbVersion.ObjToDate() != currentVersion.ObjToDate())
|
||||
{
|
||||
throw new VersionExceptions(string.Format("UpdateVersionValidation {0} Not the latest version ", versionColumn.PropertyName));
|
||||
}
|
||||
}
|
||||
else if (versionColumn.PropertyInfo.PropertyType.IsIn(UtilConstants.ByteArrayType))
|
||||
{
|
||||
if (UtilMethods.GetLong((byte[])dbVersion) > UtilMethods.GetLong((byte[])currentVersion))
|
||||
if (UtilMethods.GetLong((byte[])dbVersion) != UtilMethods.GetLong((byte[])currentVersion))
|
||||
{
|
||||
throw new VersionExceptions(string.Format("UpdateVersionValidation {0} Not the latest version ", versionColumn.PropertyName));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user