Relationship between different context classes Entity Framework

3

I have a problem saving an object because it has a relationship in a different context, I would like to know if there is a way to solve this problem.

    
asked by anonymous 08.06.2015 / 20:48

1 answer

6

Does not exist.

Not only is the design definition that matters in the Entity Framework: for all relationships and mappings to work correctly, they need to be defined in the same context.

It does not make much sense, in fact, to use objects from different contexts. The context maps a portion of the database. If this data is not accessible by it, and if this data is in a place that is beyond its definition, then that mapping will not be possible.

Reconsider changing your contexts so that all objects can be in a single context, considering that there is dependency between them.

    
08.06.2015 / 20:56