Browse Source

Db.DbMain.IsPrimaryKey BUG

pull/12/MERGE
sunkaixuan 6 years ago
parent
commit
1414493d0b
  1. 3
      Src/Asp.Net/SqlSugar/Abstract/DbMaintenanceProvider/Methods.cs

3
Src/Asp.Net/SqlSugar/Abstract/DbMaintenanceProvider/Methods.cs

@ -97,7 +97,8 @@ namespace SqlSugar
Check.Exception(!isAny, string.Format("Table {0} does not exist", tableName)); Check.Exception(!isAny, string.Format("Table {0} does not exist", tableName));
var columns = GetColumnInfosByTableName(tableName); var columns = GetColumnInfosByTableName(tableName);
if (columns.IsNullOrEmpty()) return false; if (columns.IsNullOrEmpty()) return false;
return columns.Any(it => it.IsPrimarykey = true && it.DbColumnName.Equals(columnName, StringComparison.CurrentCultureIgnoreCase)); var result=columns.Any(it => it.IsPrimarykey == true && it.DbColumnName.Equals(columnName, StringComparison.CurrentCultureIgnoreCase));
return result;
} }
public virtual bool IsIdentity(string tableName, string columnName) public virtual bool IsIdentity(string tableName, string columnName)
{ {

Loading…
Cancel
Save