diff --git a/Src/Asp.NetCore2/SqlSeverTest/UnitTest/UnitUpdateColums.cs b/Src/Asp.NetCore2/SqlSeverTest/UnitTest/UnitUpdateColums.cs new file mode 100644 index 000000000..555b76f05 --- /dev/null +++ b/Src/Asp.NetCore2/SqlSeverTest/UnitTest/UnitUpdateColums.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace OrmTest +{ + internal class UnitUpdateColums + { + public static void Init() + { + var db = NewUnitTest.Db; + db.CodeFirst.InitTables(); + db.Updateable(new DemoUpdateColums() { Id = 1 }).UpdateColumns(it => new + { + it.DBTYPE, + it.Name + }).ExecuteCommand(); + } + + } + public class DemoUpdateColums + { + [SqlSugar.SugarColumn(IsPrimaryKey =true,ColumnName ="MYID")] + public int Id { get; set; } + [SqlSugar.SugarColumn(ColumnName = "myDBTYPE")] + public SqlSugar.DbType? DBTYPE { get; set; } + [SqlSugar.SugarColumn(ColumnName = "myname")] + public String Name { get; set; } + } +}