private EntityConnection GetConnection(AzureDataConfig config) { EntityConnectionStringBuilder bldr = new EntityConnectionStringBuilder(); //bldr.Metadata = "res://*/Storage.WAMSData.csdl|res://*/Storage.WAMSData.ssdl|res://*/Storage.WAMSData.msl"; //metadata=res://*/Storage.AMSDashboard.csdl|res://*/Storage.AMSDashboard.ssdl|res://*/Storage.AMSDashboard.msl;provider=System.Data.SqlClient;provider connection string="data source=AMCFALL\SQL2014;initial catalog=AMSDashboard;integrated security=True;MultipleActiveResultSets=True;App=EntityFramework" bldr.Metadata = "res://*/Storage.AMSDashboard.csdl|res://*/Storage.AMSDashboard.ssdl|res://*/Storage.AMSDashboard.msl"; bldr.Provider = "System.Data.SqlClient"; bldr.ProviderConnectionString = config.BasicConnectionString; return(new EntityConnection(bldr.ConnectionString)); }
public List <MediaServicesAccount> SaveMediaServiceAccount(MediaServicesAccount acct, AzureDataConfig deploymentToTest) { using (var dataContext = new AMSDashboardEntities1(GetConnection(deploymentToTest).ConnectionString)) { dataContext.MediaServicesAccounts.Add(acct); dataContext.SaveChanges(); return(GetAccounts()); } }