mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-10-15 18:55:07 +08:00
update sqlite
This commit is contained in:
@@ -11,7 +11,10 @@ namespace SqlSugar
|
||||
{
|
||||
if (entityInfo.Columns.HasValue()&&entityInfo.IsDisabledUpdateAll==false)
|
||||
{
|
||||
Check.Exception(entityInfo.Columns.Where(it => it.IsPrimarykey).Count() > 1, "Use Code First ,The primary key must not exceed 1");
|
||||
if (entityInfo.Columns.Where(it => it.IsPrimarykey).Count() > 1)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var tableName = GetTableName(entityInfo);
|
||||
var dbColumns = this.Context.DbMaintenance.GetColumnInfosByTableName(tableName,false);
|
||||
|
@@ -17,8 +17,15 @@ namespace OrmTest
|
||||
Db.DbMaintenance.TruncateTable<Test00111>();
|
||||
Db.Insertable(new Test00111()).ExecuteCommand();
|
||||
var list = Db.Queryable<Test00111>().ToList();
|
||||
Db.CodeFirst.InitTables<Test00111121>();
|
||||
}
|
||||
public class Test00111121
|
||||
{
|
||||
[SugarColumn(IsPrimaryKey = true)]
|
||||
public string id { get; set; }
|
||||
[SugarColumn(IsPrimaryKey =true)]
|
||||
public string creater { get; set; }
|
||||
}
|
||||
|
||||
public class Test00111
|
||||
{
|
||||
public int id { get; set; }
|
||||
|
Reference in New Issue
Block a user