Last post Jul 11, 2013 02:28 AM by Saritha.S.R
Jul 02, 2013 05:28 AM|Saritha.S.R|LINK
I have two different entity models (ie, 2 edmx files).I need to access these two models via wcf data service .If one edmx its possible tom connect through the following lined.
public class WcfDataService : ODataService // testEntities is my enity
How can I add multiple entities in this service. Pls help , its urgent.
Jul 02, 2013 06:50 AM|Illeris|LINK
Unlikely. The ODataService is bound to the model. You can change the connection string to change the model binding, but I have no knowledge you can change models. The options you have : merge the models, or create 2 services.
Jul 04, 2013 05:12 AM|sukumarraju|LINK
In your DataService derived class override the
CreateDataSource method and in it figure out the right connect string, create a new instance of the EF object context for the connection string and return it. The WCF Data Service will not use the default constructor on the EF object context then,
it's completely up to you construct the instance with the right connection string.
Jul 11, 2013 02:28 AM|Saritha.S.R|LINK
Thanks for your reply. But I didnt get the solution you mentioned here. Can you please give me a sample code snippet to do the same.