mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-08-23 22:11:36 +08:00
Add unit test
This commit is contained in:
parent
44e2fc1bc4
commit
36ba2c62c4
44
Src/Asp.NetCore2/SqlSeverTest/UnitTest/UnitTest.cs
Normal file
44
Src/Asp.NetCore2/SqlSeverTest/UnitTest/UnitTest.cs
Normal file
@ -0,0 +1,44 @@
|
|||||||
|
using SqlSugar;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Text;
|
||||||
|
|
||||||
|
namespace OrmTest
|
||||||
|
{
|
||||||
|
internal class Unitdfafaaa
|
||||||
|
{
|
||||||
|
public static void Init()
|
||||||
|
{
|
||||||
|
var db = NewUnitTest.Db;
|
||||||
|
db.CodeFirst.InitTables<Invoice>();
|
||||||
|
var result = db.Updateable<Invoice>(new Invoice() { })
|
||||||
|
|
||||||
|
.WhereColumns(c => new { c.comp_code, c.adi_order, c.invoice_no, c.cust_po_no })
|
||||||
|
|
||||||
|
.UpdateColumns(u => new { u.customer_original_po })
|
||||||
|
|
||||||
|
.ExecuteCommandAsync().GetAwaiter().GetResult();
|
||||||
|
}
|
||||||
|
[SqlSugar.SugarTable("inv_master")]
|
||||||
|
|
||||||
|
public class Invoice
|
||||||
|
|
||||||
|
{
|
||||||
|
|
||||||
|
[SqlSugar.SugarColumn(IsIdentity = true)]
|
||||||
|
|
||||||
|
public long id { get; set; }
|
||||||
|
|
||||||
|
public string comp_code { get; set; } = "a";
|
||||||
|
|
||||||
|
public string adi_order { get; set; } = "a";
|
||||||
|
|
||||||
|
public string invoice_no { get; set; } = "a";
|
||||||
|
|
||||||
|
public string cust_po_no { get; set; } = "a";
|
||||||
|
|
||||||
|
public string customer_original_po { get; set; } = "a";
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user