Browse Source

Update .net core project

SqlSugar5
sunkaixuan 2 years ago
parent
commit
8510b8de57
  1. 4
      Src/Asp.NetCore2/SqlSugar/Realization/Dm/CodeFirst/DmCodeFirst.cs
  2. 4
      Src/Asp.NetCore2/SqlSugar/Realization/Kdbndp/CodeFirst/KdbndpCodeFirst.cs
  3. 4
      Src/Asp.NetCore2/SqlSugar/Realization/MySql/CodeFirst/MySqlCodeFirst.cs
  4. 4
      Src/Asp.NetCore2/SqlSugar/Realization/Oscar/CodeFirst/OscarCodeFirst.cs
  5. 4
      Src/Asp.NetCore2/SqlSugar/Realization/PostgreSQL/CodeFirst/PostgreSQLCodeFirst.cs
  6. 4
      Src/Asp.NetCore2/SqlSugar/Realization/QuestDB/CodeFirst/QuestDBCodeFirst.cs
  7. 6
      Src/Asp.NetCore2/SqlSugar/Realization/Sqlite/CodeFirst/SqliteCodeFirst.cs

4
Src/Asp.NetCore2/SqlSugar/Realization/Dm/CodeFirst/DmCodeFirst.cs

@ -19,6 +19,10 @@ namespace SqlSugar
DbColumnInfo dbColumnInfo = this.EntityColumnToDbColumn(entityInfo, tableName, item);
columns.Add(dbColumnInfo);
}
if (entityInfo.IsCreateTableFiledSort)
{
columns = columns.OrderBy(c => c.CreateTableFieldSort).ToList();
}
}
this.Context.DbMaintenance.CreateTable(tableName, columns,true);
}

4
Src/Asp.NetCore2/SqlSugar/Realization/Kdbndp/CodeFirst/KdbndpCodeFirst.cs

@ -19,6 +19,10 @@ namespace SqlSugar
DbColumnInfo dbColumnInfo = this.EntityColumnToDbColumn(entityInfo, tableName, item);
columns.Add(dbColumnInfo);
}
if (entityInfo.IsCreateTableFiledSort)
{
columns = columns.OrderBy(c => c.CreateTableFieldSort).ToList();
}
}
this.Context.DbMaintenance.CreateTable(tableName, columns,true);
}

4
Src/Asp.NetCore2/SqlSugar/Realization/MySql/CodeFirst/MySqlCodeFirst.cs

@ -25,6 +25,10 @@ namespace SqlSugar
DbColumnInfo dbColumnInfo = this.EntityColumnToDbColumn(entityInfo, tableName, item);
columns.Add(dbColumnInfo);
}
if (entityInfo.IsCreateTableFiledSort)
{
columns = columns.OrderBy(c => c.CreateTableFieldSort).ToList();
}
}
this.Context.DbMaintenance.CreateTable(tableName, columns,true);
}

4
Src/Asp.NetCore2/SqlSugar/Realization/Oscar/CodeFirst/OscarCodeFirst.cs

@ -19,6 +19,10 @@ namespace SqlSugar
DbColumnInfo dbColumnInfo = this.EntityColumnToDbColumn(entityInfo, tableName, item);
columns.Add(dbColumnInfo);
}
if (entityInfo.IsCreateTableFiledSort)
{
columns = columns.OrderBy(c => c.CreateTableFieldSort).ToList();
}
}
this.Context.DbMaintenance.CreateTable(tableName, columns,true);
}

4
Src/Asp.NetCore2/SqlSugar/Realization/PostgreSQL/CodeFirst/PostgreSQLCodeFirst.cs

@ -29,6 +29,10 @@ namespace SqlSugar
DbColumnInfo dbColumnInfo = this.EntityColumnToDbColumn(entityInfo, tableName, item);
columns.Add(dbColumnInfo);
}
if (entityInfo.IsCreateTableFiledSort)
{
columns = columns.OrderBy(c => c.CreateTableFieldSort).ToList();
}
}
columns = columns.OrderBy(it => it.IsPrimarykey ? 0 : 1).ToList();
this.Context.DbMaintenance.CreateTable(tableName, columns,true);

4
Src/Asp.NetCore2/SqlSugar/Realization/QuestDB/CodeFirst/QuestDBCodeFirst.cs

@ -30,6 +30,10 @@ namespace SqlSugar
DbColumnInfo dbColumnInfo = this.EntityColumnToDbColumn(entityInfo, tableName, item);
columns.Add(dbColumnInfo);
}
if (entityInfo.IsCreateTableFiledSort)
{
columns = columns.OrderBy(c => c.CreateTableFieldSort).ToList();
}
}
columns = columns.OrderBy(it => it.IsPrimarykey ? 0 : 1).ToList();
foreach (var propety in entityInfo.Type.GetProperties())

6
Src/Asp.NetCore2/SqlSugar/Realization/Sqlite/CodeFirst/SqliteCodeFirst.cs

@ -11,7 +11,7 @@ namespace SqlSugar
{
if (entityInfo.Columns.HasValue()&&entityInfo.IsDisabledUpdateAll==false)
{
if (entityInfo.Columns.Where(it => it.IsPrimarykey).Count() > 1)
if (entityInfo.Columns.Where(it => it.IsPrimarykey).Count() > 1)
{
return;
}
@ -103,6 +103,10 @@ namespace SqlSugar
DbColumnInfo dbColumnInfo = this.EntityColumnToDbColumn(entityInfo, tableName, item);
columns.Add(dbColumnInfo);
}
if (entityInfo.IsCreateTableFiledSort)
{
columns = columns.OrderBy(c => c.CreateTableFieldSort).ToList();
}
}
this.Context.DbMaintenance.CreateTable(tableName, columns,true);
}

Loading…
Cancel
Save