EF Core 2.0:Fluent API-定义为主键和外键

时间:2018-07-26 21:59:53

标签: c# orm ef-core-2.0

我在“ OnModelCreating”方法中具有以下代码。我很难进行这项工作,因为Child对象中的“ Id”在modelBuilder.Entity [Child] ....和modelBuilder [GrandChild] ....配置中既充当主键又充当外键。有没有办法做到这一点?

父母-(1:m)->子女-(1:m)->祖父母

test_

0 个答案:

没有答案