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
638d12309a
commit
3cf634eb62
@ -31,9 +31,32 @@ namespace OrmTest
|
|||||||
enumType = x.enumType ,
|
enumType = x.enumType ,
|
||||||
SerialNo = x.SerialNo
|
SerialNo = x.SerialNo
|
||||||
}).ToList();
|
}).ToList();
|
||||||
|
db.Aop.OnLogExecuting = (s, p) => Console.WriteLine(s);
|
||||||
|
db.CurrentConnectionConfig.MoreSettings = new ConnMoreSettings()
|
||||||
|
{
|
||||||
|
IsAutoToUpper = false
|
||||||
|
};
|
||||||
|
db.CodeFirst.InitTables<CodeFirstNoUpper>();
|
||||||
|
db.Insertable(new CodeFirstNoUpper() { Id = Guid.NewGuid() + "", Name = "a" }).ExecuteCommand();
|
||||||
|
var list3 = db.Queryable<CodeFirstNoUpper>().Where(it => it.Id != null).ToList();
|
||||||
|
db.Updateable(list3).ExecuteCommand();
|
||||||
|
db.Deleteable(list3).ExecuteCommand();
|
||||||
|
db.Updateable(list3.First()).ExecuteCommand();
|
||||||
|
db.Deleteable<CodeFirstNoUpper>().Where(it => it.Id != null).ExecuteCommand();
|
||||||
|
db.Updateable<CodeFirstNoUpper>().SetColumns(it => it.Name == "a").Where(it => it.Id != null).ExecuteCommand();
|
||||||
|
db.Updateable<CodeFirstNoUpper>().SetColumns(it => new CodeFirstNoUpper()
|
||||||
|
{
|
||||||
|
Name = "a"
|
||||||
|
}).Where(it => it.Id != null).ExecuteCommand();
|
||||||
Console.WriteLine("#### CodeFirst end ####");
|
Console.WriteLine("#### CodeFirst end ####");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
public class CodeFirstNoUpper
|
||||||
|
{
|
||||||
|
[SugarColumn(IsPrimaryKey = true)]
|
||||||
|
public string Id { get; set; }
|
||||||
|
public string Name { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
public class EnumTypeClass
|
public class EnumTypeClass
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user