Question

I have two .edmx files each containing different entities, using the same database. On file one i have my app logic entities, one of them is a table called Report. On the other file i have infrastructure entities such as User table and some authentication stuff.

I want to add a Navigation property from Report on file one to use User on the other file. Is it possible ? I am used to just drawing an association with the toolbox but I don't see how i can stretch the line from one designer to the other.

Was it helpful?

Solution

It is not possible. You must map User entity again in the EDMX with Report entity but in such case you must be very careful with code generation. If both your EDMX produce entities in the same namespace or if you are using POCOs you must avoid User entity to generate class again - it means modifying code generation template.

EDMX has some limited support for reusing types but it is possible only on conceptual level (database level and mapping level must be shared) and because of that it is possible only if you don't use EF designer and maintain EDMX manually as XML.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top