Browse Source

Add unit test

pull/32/head
sunkaixuan 2 years ago
parent
commit
6f58bf7804
  1. 30
      Src/Asp.NetCore2/SqlSeverTest/UnitTest/UnitUpdateColums.cs

30
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<DemoUpdateColums>();
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; }
}
}
Loading…
Cancel
Save