views:

77

answers:

1

I am building a application with these patterns: Silverlight, RIA, EF, Prism, SL Unit Testing.

This project will have lots of entities and lots of modules referencing those entities. Each entity is in its own RIA Service Library along with the RIA domain service and associated metadata.

I am running into problems when I reference a certain table in two different entities. For example table bar exists in entity1 and entity2.

My Question: Is it good practice to have the same table in multiple entities (.edmx files)?

If so what are good ways to avoid them causing a mulitple reference error?

If not what do I do when I need that table in another entity?

+1  A: 

Normally, when you start working with EF (and most ORMs), you tend towards having an entity-per-table relationship, or at least, a table->entity hierarchy relationship, if you have inheritance in your entities.

If you're trying to refer to the same table from 2 separate entity types, you probably need to pull out a shared, single entity type that's refered to by both of your other entities.

Reed Copsey