update sqlite

This commit is contained in:
sunkaixuan 2022-04-15 20:14:26 +08:00
parent 88e74cdd0d
commit b01c0488b4
2 changed files with 12 additions and 2 deletions

View File

@ -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);

View File

@ -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; }