The relationship from _ to _ is not supported because the owned entity type _ cannot be on the principal side of a non-ownership relationship

.net-core c# ef-fluent-api entity-framework-core

Popular Answer

Change the builder. x.Purchase = OwnsOne(x). Builder; HasForeignKey("ShadowId"); x.Purchase = HasOne(x). HasForeignKey("ShadowId");

You may create entity types in EF Core that can only ever be accessed via other entity types' navigation properties. We refer to them as owned entity kinds. An owned entity type's owner is the entity that contains it. ´

https://docs.microsoft.com/en-us/ef/core/modeling/owned-entities

0
5/17/2019 6:24:11 PM


Related Questions





Related

Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow