mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-08-23 13:06:50 +08:00
Add unit test
This commit is contained in:
parent
25da12808b
commit
6f58bf7804
30
Src/Asp.NetCore2/SqlSeverTest/UnitTest/UnitUpdateColums.cs
Normal file
30
Src/Asp.NetCore2/SqlSeverTest/UnitTest/UnitUpdateColums.cs
Normal file
@ -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…
Reference in New Issue
Block a user