Add attribute propertty IsOnlyIgnoreUpdate

This commit is contained in:
sunkaixuan
2019-05-31 20:22:27 +08:00
parent 19ab13134a
commit c2c1a013d5
6 changed files with 29 additions and 1 deletions

View File

@@ -38,6 +38,20 @@ namespace OrmTest
Dc=it.Int
}).ToSql().Key;
UValidate.Check(sql, "SELECT [Dc] AS [DcNull] , [Int] AS [Dc] FROM [UnitSelectTest]", "Queryable");
sql= Db.Updateable<UnitSelectTest2>(new UnitSelectTest2()).ToSql().Key;
}
public class UnitSelectTest2
{
[SqlSugar.SugarColumn(IsOnlyIgnoreUpdate = true)]
public decimal? DcNull { get; set; }
public decimal Dc { get; set; }
public int? IntNull { get; set; }
[SqlSugar.SugarColumn(IsPrimaryKey = true)]
public decimal Int { get; set; }
}
public class UnitSelectTest

View File

@@ -10,7 +10,7 @@ namespace OrmTest
{
public static void Check(object a, object b, object name)
{
if (a?.ToString() != b?.ToString())
if (a?.ToString()?.Trim() != b?.ToString()?.Trim())
{
throw new Exception(name + " error");
}