- 补充 GetTableByEntity 当属性名或特性名重复时的友好错误提示;

This commit is contained in:
28810
2019-12-04 15:37:56 +08:00
parent 8c770a3ffb
commit 539e76c28e
2 changed files with 52 additions and 0 deletions

View File

@ -195,6 +195,9 @@ namespace FreeSql.Internal
col.DbInsertValue = colattr.ServerTime == DateTimeKind.Local ? common.Now : common.NowUtc;
}
if (trytb.Columns.ContainsKey(colattr.Name)) throw new Exception($"ColumnAttribute.Name {colattr.Name} 重复存在,请检查(注意:不区分大小写)");
if (trytb.ColumnsByCs.ContainsKey(p.Name)) throw new Exception($"属性名 {p.Name} 重复存在,请检查(注意:不区分大小写)");
trytb.Columns.Add(colattr.Name, col);
trytb.ColumnsByCs.Add(p.Name, col);
columnsList.Add(col);