Ejemplo n.º 1
0
 public ExtendedDataBase(string connectionString)
     : base(EntityConnectionWrapperUtils.CreateEntityConnectionWithWrappers(
                connectionString,
                "EFTracingProvider",
                "EFCachingProvider"
                ), false)
 {
 }
Ejemplo n.º 2
0
 public ExtendedNorthwindEntities(string connectionString)
     : base(EntityConnectionWrapperUtils.CreateEntityConnectionWithWrappers(
                connectionString,
                "EFTracingProvider",
                "EFCachingProvider"
                ))
 {
 }
Ejemplo n.º 3
0
 public RentlerBackupEntitiesExtensions(string connectionString)
     : base(EntityConnectionWrapperUtils.CreateEntityConnectionWithWrappers(
                connectionString,
                "EFTracingProvider",
                "EFCachingProvider"
                ))
 {
 }
Ejemplo n.º 4
0
        public static DbConnection GetConnection(string nameOrConnectionString)
        {
            try
            {
                // this only supports entity connection strings http://msdn.microsoft.com/en-us/library/cc716756.aspx
                return(EntityConnectionWrapperUtils.CreateEntityConnectionWithWrappers(nameOrConnectionString, "EFTracingProvider",
                                                                                       "EFCachingProvider"));
            }
            catch (ArgumentException ex)
            {
                if (nameOrConnectionString.Contains('='))
                {
                    nameOrConnectionString = nameOrConnectionString.Substring(nameOrConnectionString.IndexOf('=') + 1);
                }
                // an invalid entity connection string is assumed to be a normal connection string name or connection string (Code First)
                ConnectionStringSettings connectionStringSetting =
                    ConfigurationManager.ConnectionStrings[nameOrConnectionString];
                string connectionString;
                string providerName;

                if (connectionStringSetting != null)
                {
                    connectionString = connectionStringSetting.ConnectionString;
                    providerName     = connectionStringSetting.ProviderName;
                }
                else
                {
                    providerName     = "System.Data.SqlClient";
                    connectionString = nameOrConnectionString;
                }
                var connect = EFConnectionWrapperFactory.GetConnection();

                var wrapperConnectionString =
                    String.Format(@"wrappedProvider={0};{1}", providerName, connectionString);
                connect.ConnectionString = wrapperConnectionString;

                return(connect);
            }
        }
 public BrickHouseFitnessContext(): base(EntityConnectionWrapperUtils.CreateEntityConnectionWithWrappers(ConfigurationManager.ConnectionStrings["BrickHouseFitnessContext"].ConnectionString, "EFTracingProvider"), true)
 {
 }
Ejemplo n.º 6
0
 public LoggedContext(string connectionString)
     : base(EntityConnectionWrapperUtils.CreateEntityConnectionWithWrappers(connectionString)
 {
 }