Browse Source

bug: generic query

pull/40/head
sunkaixuan 1 year ago
parent
commit
e863e8eb59
  1. 7
      Src/Asp.Net/SqlSugar/Abstract/SqlBuilderProvider/SqlBuilderProvider.cs

7
Src/Asp.Net/SqlSugar/Abstract/SqlBuilderProvider/SqlBuilderProvider.cs

@ -37,6 +37,13 @@ namespace SqlSugar
Check.ArgumentNullException(name, string.Format(ErrorMessage.ObjNotExist, "Table Name")); Check.ArgumentNullException(name, string.Format(ErrorMessage.ObjNotExist, "Table Name"));
if (!name.Contains("<>f__AnonymousType") &&name.IsContainsIn("(", ")", SqlTranslationLeft)&&name!= "Dictionary`2") if (!name.Contains("<>f__AnonymousType") &&name.IsContainsIn("(", ")", SqlTranslationLeft)&&name!= "Dictionary`2")
{ {
var tableInfo = this.Context
.MappingTables?
.FirstOrDefault(it => it.EntityName.Equals(name, StringComparison.CurrentCultureIgnoreCase));
if (tableInfo != null)
{
return GetTranslationColumnName(tableInfo.DbTableName);
}
return name; return name;
} }
if (Context.MappingTables == null) if (Context.MappingTables == null)

Loading…
Cancel
Save