Upgrade Silverlight to 5,ado today. ENT EF also upgraded to 5 with NuGet. It turns out that the EF at 5 does not have 4 of that sort of partial method by default.
Of course, you can replace the properties of the generator with the default, which is note. You can also have partial methods as in version 4.
But I found the EF5 below more intelligent. Better use. The link string for EF has a related class
EntityConnection
It can be manipulated.
See MSDN:
Http://msdn.microsoft.com/en-us/library/system.data.entityclient.entityconnection.connectionstring.aspx
This makes it more flexible to change the database dynamically.
Just customize a method and then return the string to the entityconnection link to
Specify the provider name, server and database. string providerName = "System.Data.SqlClient"; string serverName = "."; String databaseName = "AdventureWorks";//Initialize the connection string builder for the //underlying provider. SqlConnectionStringBuilder Sqlbuilder = new SqlConnectionStringBuilder ();//Set the properties for the data source.sqlb Uilder. DataSource = Servername;sqlbuilder.initialcatalog = Databasename;sqlbuilder.integratedsecurity = true;//Build the SqlConnection connection String. string providerstring = sqlbuilder.tostring ();//Initialize the Entityconnectionstringbuilder.entityconnectionstringbuilder Entitybuilder = new Entityconnectionstringbuilder ();// Set the provider Name.entityBuilder.Provider = providername;//Set the provider-specific connection String.entitybuilder . providerconnectionstring = providerstring;//Set the Metadata location.entityBuilder.Metadata = @ "res://*/ adventureworksmodel.csdl| Res://*/adventureworksmodel.ssdl| RES://*/ADVENTUREWORKSMODEL.MSL "; Console.WriteLine (Entitybuilder.tostring ());
Dynamically changing database connections in Entity Framework 5