/// <summary> /// Initializes a new instance of the <see cref="Database"/> class. /// </summary> /// <param name="dbProvider">The db provider.</param> public Database(DbProviders.DbProvider dbProvider) { Check.Require(dbProvider != null, "dbProvider could not be null."); this.dbProvider = dbProvider; this.queryFactory = dbProvider.GetQueryFactory(); }
public DirectDapperQueryProvider(ISqlFileProvider sqlFileProvider, ISqlQueryFactory sqlQueryFactory, IQueryHelper queryHelper) { this._sqlFileProvider = sqlFileProvider; this._sqlQueryFactory = sqlQueryFactory; this.Helper = queryHelper; }
/// <summary> /// Initializes a new instance of the <see cref="Database"/> class. /// </summary> /// <param name="type">The type.</param> /// <param name="connectionString">The connection string.</param> public Database(DatabaseType type, string connectionString) { Check.Require(!string.IsNullOrEmpty(connectionString), "connectionString could not be null or empty."); //switch (type) //{ // case DatabaseType.MsAccess: // this.dbProvider = DbProviders.DbProviderFactory.CreateDbProvider(null, typeof(DbProviders.MsAccess.AccessDbProvider).ToString(), connectionString); // break; // case DatabaseType.SqlServer: // this.dbProvider = DbProviders.DbProviderFactory.CreateDbProvider(null, typeof(DbProviders.SqlServer.SqlDbProvider).ToString(), connectionString); // break; // case DatabaseType.SqlServer9: // this.dbProvider = DbProviders.DbProviderFactory.CreateDbProvider(null, typeof(DbProviders.SqlServer.SqlDbProvider9).ToString(), connectionString); // break; // case DatabaseType.MySql: // this.dbProvider = DbProviders.DbProviderFactory.CreateDbProvider("NBearLite.AdditionalDbProviders", "NBearLite.DbProviders.MySql.MySqlDbProvider", connectionString); // break; // case DatabaseType.Oracle: // this.dbProvider = DbProviders.DbProviderFactory.CreateDbProvider(null, typeof(DbProviders.Oracle.OracleDbProvider).ToString(), connectionString); // break; // case DatabaseType.Sqlite: // this.dbProvider = DbProviders.DbProviderFactory.CreateDbProvider("NBearLite.AdditionalDbProviders", "NBearLite.DbProviders.Sqlite.SqliteDbProvider", connectionString); // break; // case DatabaseType.PostgreSql: // this.dbProvider = DbProviders.DbProviderFactory.CreateDbProvider("NBearLite.AdditionalDbProviders", "NBearLite.DbProviders.PostgreSql.PostgreSqlDbProvider", connectionString); // break; // case DatabaseType.DB2: // this.dbProvider = DbProviders.DbProviderFactory.CreateDbProvider("NBearLite.AdditionalDbProviders", "NBearLite.DbProviders.DB2.DB2DbProvider", connectionString); // break; // default: // throw new NotSupportedException("Unknow DatabaseType."); //} this.dbProvider = new DbProviders.SqlServer.SqlDbProvider9(connectionString); this.queryFactory = dbProvider.GetQueryFactory(); }
/// <summary> /// Initializes a new instance of the <see cref="Database"/> class. /// </summary> /// <param name="connectionStringName">Name of the connection string.</param> public Database(string connectionStringName) { this.dbProvider = DbProviders.DbProviderFactory.CreateDbProvider(connectionStringName); this.queryFactory = dbProvider.GetQueryFactory(); }
public AbpDirectDapperQueryProvider(ISqlFileProvider sqlFileProvider, ISqlQueryFactory sqlQueryFactory, IQueryHelper queryHelper, IIocManager iocManager) : base(sqlFileProvider, sqlQueryFactory, queryHelper) { IocManager = iocManager; }
public IDirectDapperQueryProvider SetQueryFactory(ISqlQueryFactory factory) { _sqlQueryFactory = factory; return(this); }