mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2026-01-09 09:55:05 +08:00
Update sqlite
This commit is contained in:
@@ -13,6 +13,20 @@ namespace OrmTest
|
||||
public static void Init()
|
||||
{
|
||||
var db = NewUnitTest.Db;
|
||||
db.CodeFirst.InitTables<Unitdfadfsdy>();
|
||||
db.CurrentConnectionConfig.MoreSettings = new ConnMoreSettings()
|
||||
{
|
||||
SqliteCodeFirstEnableDefaultValue=true
|
||||
};
|
||||
db.CodeFirst.InitTables<UNITDFADFSDY>();
|
||||
db.DbMaintenance.DropTable<Unitdfadfsdy>();
|
||||
db.CodeFirst.InitTables<Unitdfadfsdy>();
|
||||
db.Insertable(new Unitdfadfsdy() { Id = 1 }).ExecuteCommand();
|
||||
db.CodeFirst.InitTables<UNITDFADFSDY>();
|
||||
var list=db.Queryable<UNITDFADFSDY>().ToList();
|
||||
db.CodeFirst.InitTables<UNITDFADFSdY>();
|
||||
if (list.First().a != "1") throw new Exception("unit error");
|
||||
db = NewUnitTest.Db;
|
||||
db.CodeFirst.InitTables(typeof(SqlSugarTestEntity));
|
||||
db.DbMaintenance.TruncateTable<SqlSugarTestEntity>();
|
||||
SqlSugarTestEntity entity = new SqlSugarTestEntity { Id=1,BarCode = "1111", PatientName = "小明" };
|
||||
@@ -38,6 +52,24 @@ namespace OrmTest
|
||||
}).ToList();//没溢出,但结果,Aa 都是初值即是空??
|
||||
}
|
||||
}
|
||||
public class Unitdfadfsdy
|
||||
{
|
||||
public int Id { get; set; }
|
||||
}
|
||||
public class UNITDFADFSDY
|
||||
{
|
||||
public int Id { get; set; }
|
||||
[SugarColumn(DefaultValue ="1")]
|
||||
public string a { get; set; }
|
||||
}
|
||||
public class UNITDFADFSdY
|
||||
{
|
||||
public int Id { get; set; }
|
||||
[SugarColumn(DefaultValue = "1")]
|
||||
public string a { get; set; }
|
||||
[SugarColumn(DefaultValue = "10")]
|
||||
public int num { get; set; }
|
||||
}
|
||||
[SqlSugar.SugarTable("SQLSUGARTEST")]
|
||||
[SqlSugar.SplitTable(SplitType._Custom01, typeof(SplitTableService))]
|
||||
public class SqlSugarTestEntity
|
||||
|
||||
Reference in New Issue
Block a user