Browse Source

Update .net framework project

pull/19/head
sunkaixuan 2 years ago
parent
commit
41cadf3117
  1. 4
      Src/Asp.Net/SqlSugar/Abstract/CodeFirstProvider/CodeFirstProvider.cs

4
Src/Asp.Net/SqlSugar/Abstract/CodeFirstProvider/CodeFirstProvider.cs

@ -228,6 +228,8 @@ namespace SqlSugar
}
if (!this.Context.DbMaintenance.IsAnyIndex(item.IndexName))
{
var querybulder = InstanceFactory.GetSqlbuilder(this.Context.CurrentConnectionConfig);
querybulder.Context = this.Context;
var fileds = item.IndexFields
.Select(it =>
{
@ -238,7 +240,7 @@ namespace SqlSugar
}
return new KeyValuePair<string, OrderByType>(dbColumn.DbColumnName, it.Value);
})
.Select(it => it.Key + " " + it.Value).ToArray();
.Select(it => querybulder.GetTranslationColumnName(it.Key) + " " + it.Value).ToArray();
this.Context.DbMaintenance.CreateIndex(entityInfo.DbTableName, fileds, item.IndexName, item.IsUnique);
}
}

Loading…
Cancel
Save