mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-10-26 10:49:20 +08:00
Add json
This commit is contained in:
@@ -79,8 +79,30 @@ namespace OrmTest
|
||||
{
|
||||
throw new Exception("unit error");
|
||||
}
|
||||
db.CodeFirst.InitTables<UnitJsonTestAlter>();
|
||||
db.Insertable(new UnitJsonTestAlter() { Order1 = new Order() { } }).ExecuteCommand();
|
||||
db.CodeFirst.InitTables<UnitJsonTestAlter>();
|
||||
db.DbMaintenance.DropTable<UnitJsonTestAlter>();
|
||||
}
|
||||
}
|
||||
[SugarTable("UnitJsonTest_a7aaasss")]
|
||||
public class UnitJsonTestAlter
|
||||
{
|
||||
[SqlSugar.SugarColumn(IsPrimaryKey =true,IsIdentity =true)]
|
||||
public int id { get; set; }
|
||||
[SugarColumn(IsJson = true,DefaultValue ="cast('{}' as json )")]
|
||||
public Order Order1 { get; set; }
|
||||
}
|
||||
[SugarTable("UnitJsonTest_a7aaasss")]
|
||||
public class UnitJsonTestAlteraaa
|
||||
{
|
||||
[SqlSugar.SugarColumn(IsPrimaryKey = true, IsIdentity = true)]
|
||||
public int id { get; set; }
|
||||
[SugarColumn(IsJson = true, DefaultValue = "cast('{}' as json )")]
|
||||
public Order Order1 { get; set; }
|
||||
[SugarColumn(IsJson = true, DefaultValue = "cast('{}' as json )")]
|
||||
public Order Order2 { get; set; }
|
||||
}
|
||||
public class Unitaaar2
|
||||
{
|
||||
[SugarColumn(IsJson = true, IsNullable = true)]
|
||||
|
||||
Reference in New Issue
Block a user