private static async Task<DbConnection> CreateConnection(Config config) { DbProviderFactory providerFactory = DbProviderFactories.GetFactory(config.Connection.Type ?? "System.Data.SqlClient"); DbConnection connection = providerFactory.CreateConnection(); if (connection == null) throw new ApplicationException("Could not create a connection from the specified configuration."); connection.ConnectionString = config.Connection.ConnectionString; await connection.OpenAsync(); return connection; }
internal EntityCodeBuilder(DbConnection connection, Config config) : base(connection, config) { }
internal CodeBuilder(DbConnection connection, Config config) { _connection = connection; Config = config; }