mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-08-25 01:14:33 +08:00
Add user test demo
This commit is contained in:
parent
5106d03520
commit
008892a1da
@ -34,6 +34,27 @@ namespace OrmTest
|
|||||||
X1.Id == Y1.Id)
|
X1.Id == Y1.Id)
|
||||||
.Where(X1 => X1.Id == 1)
|
.Where(X1 => X1.Id == 1)
|
||||||
.Select<VUpperOrder>().ToList();
|
.Select<VUpperOrder>().ToList();
|
||||||
|
db = NewUnitTest.Db;
|
||||||
|
db.CodeFirst.InitTables<Unitadfafay1>();
|
||||||
|
db.DbMaintenance.TruncateTable<Unitadfafay1>();
|
||||||
|
db.Insertable(new Unitadfafay1() { a = "a" }).ExecuteCommand();
|
||||||
|
db.CodeFirst.InitTables<UNITADFAFAY1>();
|
||||||
|
var bvalue=db.Queryable<UNITADFAFAY1>().First().b;
|
||||||
|
if (bvalue != "b")
|
||||||
|
{
|
||||||
|
throw new Exception("unit error");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public class Unitadfafay1
|
||||||
|
{
|
||||||
|
public string a { get; set; }
|
||||||
|
}
|
||||||
|
public class UNITADFAFAY1
|
||||||
|
{
|
||||||
|
public string a { get; set; }
|
||||||
|
[SugarColumn(DefaultValue ="b")]
|
||||||
|
public string b { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public class VUpperOrder
|
public class VUpperOrder
|
||||||
|
Loading…
Reference in New Issue
Block a user