Browse Source

Add demo

pull/26/head
sunkaixuan 2 years ago
parent
commit
223a974e00
  1. 12
      Src/Asp.Net/PgSqlTest/Demo/DemoE_CodeFirst.cs

12
Src/Asp.Net/PgSqlTest/Demo/DemoE_CodeFirst.cs

@ -38,9 +38,21 @@ namespace OrmTest
db.CodeFirst.InitTables<CodeFirstEnum>();
db.DbMaintenance.TruncateTable<CodeFirstEnum>();
db.Storageable(new CodeFirstEnum() { dbType = DbType.Access, Name = "a" }).ExecuteCommand();
db.CodeFirst.InitTables<CodeFirstArray>();
db.Insertable(new List<CodeFirstArray>() {
new CodeFirstArray() { floats = new float[] { 1 } },
new CodeFirstArray() { floats = new float[] { 1 } }
}).ExecuteCommand();
var list5=db.Queryable<CodeFirstArray>().ToList();
Console.WriteLine("#### CodeFirst end ####");
}
}
public class CodeFirstArray
{
[SugarColumn(IsArray =true,ColumnDataType = "real[]")]
public float[] floats { get; set; }
}
public class CodeFirstEnum
{
[SugarColumn(IsPrimaryKey =true)]

Loading…
Cancel
Save