Print Page | Close Window

OData and EdmKeys with Azure

Printed From: IdeaBlade
Category: DevForce
Forum Name: DevForce 2010
Forum Discription: For .NET 4.0
URL: http://www.ideablade.com/forum/forum_posts.asp?TID=2439
Printed Date: 22-Apr-2025 at 1:23pm


Topic: OData and EdmKeys with Azure
Posted By: GeorgeB
Subject: OData and EdmKeys with Azure
Date Posted: 14-Jan-2011 at 7:18am
Hi
 
When testing against the Azure development fabric, I connect to a local database and when deployed into Azure, I connect to a SQL Azure database (using EdmKeys). 
 
How do I do this when using OData? Should I override CreateDataSource()? If so how do I know which EdmKey to use?
 
I don't mind only specifying the Azure database as my testing for this is only being done in the Azure.
 
Kr
George



Replies:
Posted By: kimj
Date Posted: 14-Jan-2011 at 9:46am

Most of the usual DevForce features can still be used when the EntityManager is hosted by a data service.  So you can continue to use either EdmKeys or <connectionStrings> to hold your connection information, and DevForce will do its usual lookup based on the DataSourceKeyName attribute set on the entities in the model.  You'll define the key/connection in the web.config.

If you're using data source extensions, you would provide the extension to the EntityManager constructor by overriding the CreateDataSource method on the DataService.  If you're not using extensions there's probably no need to override this method as the default implementation will use the EM's parameterless constructor.



Print Page | Close Window