mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-08-23 22:11:36 +08:00
Add demo
This commit is contained in:
parent
2df7a440fe
commit
72d6455f5f
@ -24,9 +24,29 @@ namespace OrmTest
|
|||||||
var list = db.Queryable<CodeFirstTable1>().ToList();
|
var list = db.Queryable<CodeFirstTable1>().ToList();
|
||||||
db.CodeFirst.InitTables<PictureData>();
|
db.CodeFirst.InitTables<PictureData>();
|
||||||
db.CodeFirst.InitTables<PictureData>();
|
db.CodeFirst.InitTables<PictureData>();
|
||||||
|
db.CodeFirst.InitTables<EnumTypeClass>();
|
||||||
|
db.Insertable(new EnumTypeClass() { enumType= EnumType.x1, SerialNo= Guid.NewGuid() + "" }).ExecuteCommand();
|
||||||
|
var list2=db.Queryable<EnumTypeClass>().Select(x => new EnumTypeClass()
|
||||||
|
{
|
||||||
|
enumType = x.enumType ,
|
||||||
|
SerialNo = x.SerialNo
|
||||||
|
}).ToList();
|
||||||
Console.WriteLine("#### CodeFirst end ####");
|
Console.WriteLine("#### CodeFirst end ####");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public class EnumTypeClass
|
||||||
|
{
|
||||||
|
[SugarColumn(IsPrimaryKey = true,Length =50)]
|
||||||
|
public string SerialNo { get; set; }
|
||||||
|
[SugarColumn(ColumnDataType ="number(22,0)")]
|
||||||
|
public EnumType enumType { get; set; }
|
||||||
|
}
|
||||||
|
public enum EnumType {
|
||||||
|
x1=-1,
|
||||||
|
x2=2
|
||||||
|
}
|
||||||
|
|
||||||
[SugarTable("PictureData")]
|
[SugarTable("PictureData")]
|
||||||
public class PictureData
|
public class PictureData
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user