mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-04-24 18:04:52 +08:00
Same as the previous question
This commit is contained in:
parent
1d3ed496fa
commit
516849c51d
@ -168,6 +168,10 @@ namespace SqlSugar
|
||||
private MapperSql GetOneToManySql()
|
||||
{
|
||||
var pkColumn = this.EntityInfo.Columns.FirstOrDefault(it => it.IsPrimarykey == true);
|
||||
if (pkColumn == null && Navigat.Name2 != null)
|
||||
{
|
||||
pkColumn = this.EntityInfo.Columns.FirstOrDefault(it => it.PropertyName== Navigat.Name2);
|
||||
}
|
||||
Check.ExceptionEasy(pkColumn == null, $"{this.EntityInfo.EntityName} need primary key ",
|
||||
$"导航属性 {this.EntityInfo.EntityName}需要主键");
|
||||
var pk = pkColumn.DbColumnName;
|
||||
|
Loading…
Reference in New Issue
Block a user