mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-10-27 03:09:34 +08:00
Add attribute propertty IsOnlyIgnoreUpdate
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user