1

Closed

Embed or Do not embed entity model

description

Set to copy to output directory so that we can provide different models?
Closed Apr 2, 2009 at 9:43 PM by olegkap

comments

olegkap wrote Mar 31, 2009 at 8:26 PM

You can tell the application to use either embed or not embed entity model.
All you need to do is to change connection string in the web.config.
So for example instead of using :
<add name="SosEntities" connectionString="metadata=res://*/Sos.Sos.csdl|res://*/Sos.Sos.ssdl|res://*/Sos.Sos.msl;provider=System.Data.SqlClient;provider connection string=&quot;Data Source=<server name>;Initial Catalog=<data base name>;User ID=<user name>;Pwd=password>;MultipleActiveResultSets=True&quot;" providerName="System.Data.EntityClient" />
you should use:
<add name="SosEntities.Files" connectionString="metadata=~/bin/Sos\Sos.csdl|~/bin/Sos\Sos.ssdl|~/bin/Sos\Sos.msl;provider=System.Data.SqlClient;provider connection string=&quot;Data Source=<server name>;Initial Catalog=<data base name>;User ID=<user name>;Pwd=password>;MultipleActiveResultSets=True&quot;" providerName="System.Data.EntityClient" />
By using the second method you can specify as many connection string as you like and point them to different definition files. More then that you can specify for each operation which connection string to use so you can specify multiple versions of the servivce and make each work with different database.

wrote Mar 31, 2009 at 8:26 PM

wrote Apr 2, 2009 at 9:43 PM

wrote Feb 13, 2013 at 8:37 PM

wrote May 15, 2013 at 4:48 AM