2using System.Collections.Generic;
3using System.Configuration;
5using System.Reflection;
7using System.Threading.Tasks;
13 private static System.Configuration.Configuration AppConfig = ConfigurationManager.OpenExeConfiguration(Assembly.GetExecutingAssembly().Location);
34 #region Private Helper Methods
36 private static string BuildDataDirectory()
38 string dataDirectory = AppDomain.CurrentDomain.GetData(
"DataDirectory")?.ToString() ?? AppDomain.CurrentDomain.BaseDirectory;
39 if (dataDirectory.EndsWith(
@"\"))
41 dataDirectory = dataDirectory.Substring(0, dataDirectory.Length - 1);
46 private static string GetConnectionString(
string connectionName)
48 string connectionString;
49 ConnectionStringSettingsCollection conStrings = AppConfig.ConnectionStrings.ConnectionStrings;
51 connectionString = conStrings[connectionName].ConnectionString;
52 connectionString = connectionString.Replace(
"|DataDirectory|",
DataDirectory);
53 return connectionString;
static string DataPortalTestDatabase
static string DataPortalTestDatabaseEntities
static string EntityConnectionWithMissingDB
static string DataDirectory
static string EntityConnectionWithMissingDBConnectionStringName
static string DataPortalTestDatabaseWithInvalidDBValue
static string TestLinqToSqlContextDataContext