|
@ -18,16 +18,24 @@ namespace OrmTest |
|
|
Db.Insertable(new Test00111()).ExecuteCommand(); |
|
|
Db.Insertable(new Test00111()).ExecuteCommand(); |
|
|
var list = Db.Queryable<Test00111>().ToList(); |
|
|
var list = Db.Queryable<Test00111>().ToList(); |
|
|
Db.CodeFirst.InitTables<Test00111121>(); |
|
|
Db.CodeFirst.InitTables<Test00111121>(); |
|
|
Db.CodeFirst.InitTables<UnitByteArray>(); |
|
|
Db.CodeFirst.InitTables<UnitByteArray1>(); |
|
|
Db.Insertable(new UnitByteArray() |
|
|
Db.Insertable(new UnitByteArray1() |
|
|
{ |
|
|
{ |
|
|
Data = new byte[] { 1, 2, 123, 31, 1 } |
|
|
Data = new byte[] { 1, 2, 123, 31, 1 } |
|
|
}).ExecuteCommand(); |
|
|
}).ExecuteCommand(); |
|
|
var list2=Db.Queryable<UnitByteArray>().ToDataTable(); |
|
|
var list2=Db.Queryable<UnitByteArray1>().ToDataTable(); |
|
|
|
|
|
var x=Db.DbMaintenance.GetColumnInfosByTableName("`UnitByteArray1`", false); |
|
|
|
|
|
if (x[0].Length != 18 && x[0].Scale != 0) throw new Exception("unit test error"); |
|
|
|
|
|
if (x[1].Length != 18 && x[1].Scale != 2) throw new Exception("unit test error"); |
|
|
|
|
|
if (x[2].Length != 0 && x[2].Scale != 0) throw new Exception("unit test error"); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public class UnitByteArray |
|
|
public class UnitByteArray1 |
|
|
{ |
|
|
{ |
|
|
|
|
|
[SugarColumn(IsNullable = true, ColumnDataType = "varchar(18)")] |
|
|
|
|
|
public string Aa { get; set; } |
|
|
|
|
|
[SugarColumn(IsNullable =true, ColumnDataType = "decimal(18,2)")] |
|
|
|
|
|
public decimal A { get; set; } |
|
|
public byte[] Data { get; set; } |
|
|
public byte[] Data { get; set; } |
|
|
} |
|
|
} |
|
|
public class Test00111121 |
|
|
public class Test00111121 |
|
|