Conflicting Changes With Code First Foreign Key In Entity Framework
im using an adapter to be able to plug interfaces rather than concrete types into dbcontext. the adapter works on its own, but im having trouble with getting the any one-to-one (pa
Solution 1:
Your adapter pattern interfere with how EF works. You are providing a different implementation for the navigational properties of the entity. For example, if you access TopLevelDomainRep property several times it will return multiple instances but with the same ID/Entity Key. EF handles only single instance per context for a given primary key value.
Either you create a domain layer on top of EF entities or you use EF entities the way it was expected to.
Post a Comment for "Conflicting Changes With Code First Foreign Key In Entity Framework"