New Posts New Posts RSS Feed: Multiple data models in single project
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

Multiple data models in single project

 Post Reply Post Reply
Author
sbelini View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 13-Aug-2010
Location: Oakland
Posts: 786
Post Options Post Options   Quote sbelini Quote  Post ReplyReply Direct Link To This Post Topic: Multiple data models in single project
    Posted: 04-Oct-2010 at 4:11pm
xkubr,
 
can I take a look at your App.config/Web.config file? The error leads me to believe that something might not be quite right in one of these files.
 
As for needing to implement a datasource key resolver, it's not really necessary if you have all connectionStrings or EdmKeys. (You might also take a look at our DevForce Resource Center section which provides details on DataSourceKeys, DataSourceKeyResolvers, and DataSourceExtensions)
 
 
 


Edited by sbelini - 04-Oct-2010 at 4:15pm
Back to Top
xkubr View Drop Down
Newbie
Newbie


Joined: 01-Sep-2010
Posts: 6
Post Options Post Options   Quote xkubr Quote  Post ReplyReply Direct Link To This Post Posted: 27-Sep-2010 at 5:14am
I have followed the suggestions made in this thread:
http://www.ideablade.com/forum/forum_posts.asp?TID=1744&title=minor-problem-using-multiple-data-models-with-the-same-entity-manager

I now have the properties manually written in the developer\partial class that is exposed. My app builds without error but when I run it I get the following error:
"The connection string for Key 'POCLOOKUPENTITIES' was not found or is invalid. Check that either a connectionStrings element or EdmKey is defined for this key in the configuration file, or implement a custom IDataSourceKeyResolver."

The error occurs when I try to create a list of the lookup table objects i.e. countries from the Lookup edmx. I currently only have one lookup table modeled. Is there any way to debug how the connection string is being read\used? And\or do I need to implement the IDataSourceKeyResolver as the error message suggests?
Back to Top
xkubr View Drop Down
Newbie
Newbie


Joined: 01-Sep-2010
Posts: 6
Post Options Post Options   Quote xkubr Quote  Post ReplyReply Direct Link To This Post Posted: 27-Sep-2010 at 12:38am
Thank you for your reply. I have installed DevForce 2010 v6.0.5.0 and the build error does not appear.

My next problem is that I need to create an association between entities within the separate data models. How can I do this? Should I do this? Is there a sample I can refer to?

My high-level objective is to demonstrate the necessary functionality of DevFroce and follow best practice, hence my solution is a POC. With this in mind my above question still stands: Should I have all my entities in one model\edmx file?
Back to Top
sbelini View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 13-Aug-2010
Location: Oakland
Posts: 786
Post Options Post Options   Quote sbelini Quote  Post ReplyReply Direct Link To This Post Posted: 23-Sep-2010 at 9:27am
Hi,
 
The issue you decribed has been fixed on DevForce2010 6.0.5.0.
 
You can find the latest version of DevForce on our website.
Back to Top
xkubr View Drop Down
Newbie
Newbie


Joined: 01-Sep-2010
Posts: 6
Post Options Post Options   Quote xkubr Quote  Post ReplyReply Direct Link To This Post Posted: 23-Sep-2010 at 2:47am
I am getting the below error when building my proof of concept (POC) project with multiple data models.

Type 'Poc.DataContext.EntityRelations' already defines a member called 'EntityRelations' with the same parameter types.

Scenario & additional details:
I am using VS 2010 Prof & DevForce 2010 v6.0.4.0
I have a single solution with multiple projects. I have a single project (DataContext) containing all the data models\edmx files. I need multiple data models to separate\group the entities\tables logically, e.g. Customer, Supplier, etc. will exist in one edmx file\model and lookup tables in another. When I created the second (lookups) edmx file\model and added a lookup table e.g. Country, the project did not build, with the above error because "static EntityRelations() {}" exists in both implementations of the EntityRelations partial class within both models (in the generated code). Both models implement the same EntityManager.

What am I doing wrong? Should I have all my entities in one model\edmx file? Although I think separating out the entity models is a fairly typical requirement.
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down