|
|
@ -70,9 +70,23 @@ namespace OrmTest |
|
|
|
db.Insertable(new Unittest1011() { name = "a" }).ExecuteCommand(); |
|
|
|
db.Insertable(new Unittest22221() { name = "a" }).ExecuteCommand(); |
|
|
|
db.CodeFirst.InitTables<Unitrtqqqadfa>(); |
|
|
|
db.CodeFirst.InitTables<Unitrasdfafa>(); |
|
|
|
var id=db.Insertable(new Unitrasdfafa() { Name = "Unitrasdfafa" }).ExecuteReturnIdentity(); |
|
|
|
db.Updateable(new Unitrasdfafa() { Name = "Unitrasdfafa", id = id }).ExecuteCommand(); |
|
|
|
var xx=db.Queryable<Unitrasdfafa>().Select("*").ToDataTable(); |
|
|
|
Console.WriteLine("#### CodeFirst end ####"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
[SugarTable("Unitrasdfafa",Discrimator ="Type:1,Type2:2")] |
|
|
|
public class Unitrasdfafa |
|
|
|
{ |
|
|
|
|
|
|
|
[SugarColumn(IsIdentity =true,IsPrimaryKey =true)] |
|
|
|
public int id { get; set; } |
|
|
|
public string Name { get; set; } |
|
|
|
} |
|
|
|
|
|
|
|
[SugarTable("dbo.Unitrtqqqadfa")] |
|
|
|
public class Unitrtqqqadfa |
|
|
|
{ |
|
|
|