/// <summary> /// Configure connection to use specific Oracle provider, dialect and connection string. /// </summary> /// <param name="builder">Instance of <see cref="LinqToDbConnectionOptionsBuilder"/>.</param> /// <param name="connectionString">Oracle connection string.</param> /// <param name="dialect">Oracle dialect support level.</param> /// <param name="useNativeProvider">if <c>true</c>, <c>Oracle.DataAccess</c> provider will be used; othwerwise managed <c>Oracle.ManagedDataAccess</c>.</param> /// <returns>The builder instance so calls can be chained.</returns> public static LinqToDbConnectionOptionsBuilder UseOracle(this LinqToDbConnectionOptionsBuilder builder, string connectionString, OracleVersion dialect, bool useNativeProvider) { return(builder.UseConnectionString( OracleTools.GetDataProvider( useNativeProvider ? ProviderName.OracleNative : ProviderName.OracleManaged, null, dialect), connectionString)); }
/// <summary> /// Configure connection to use SAP HANA ODBC provider and connection string. /// </summary> /// <param name="builder">Instance of <see cref="LinqToDbConnectionOptionsBuilder"/>.</param> /// <param name="connectionString">SAP HANA connection string.</param> /// <returns>The builder instance so calls can be chained.</returns> public static LinqToDbConnectionOptionsBuilder UseSapHanaODBC(this LinqToDbConnectionOptionsBuilder builder, string connectionString) { return(builder.UseConnectionString( SapHanaTools.GetDataProvider(ProviderName.SapHanaOdbc), connectionString)); }
/// <summary> /// Configure connection to use SAP HANA default provider and connection string. /// </summary> /// <param name="builder">Instance of <see cref="LinqToDbConnectionOptionsBuilder"/>.</param> /// <param name="connectionString">SAP HANA connection string.</param> /// <returns>The builder instance so calls can be chained.</returns> /// <remarks> /// <para> /// Default provider will be <c>Sap.Data.Hana</c> native provider for .NET Framework and .NET Core applications and ODBC provider for .NET STANDARD builds. /// </para> /// </remarks> public static LinqToDbConnectionOptionsBuilder UseSapHana(this LinqToDbConnectionOptionsBuilder builder, string connectionString) { return(builder.UseConnectionString(ProviderName.SapHana, connectionString)); }
/// <summary> /// Configure connection to use specific Informix provider and connection string. /// </summary> /// <param name="builder">Instance of <see cref="LinqToDbConnectionOptionsBuilder"/>.</param> /// <param name="connectionString">Informix connection string.</param> /// <param name="useDB2Provider">if <c>true</c>, <c>IBM.Data.DB2</c> provider will be used; othwerwise <c>IBM.Data.Informix</c>.</param> /// <returns>The builder instance so calls can be chained.</returns> public static LinqToDbConnectionOptionsBuilder UseInformix(this LinqToDbConnectionOptionsBuilder builder, string connectionString, bool useDB2Provider) { return(builder.UseConnectionString( InformixTools.GetDataProvider(useDB2Provider ? ProviderName.InformixDB2 : ProviderName.Informix), connectionString)); }
/// <summary> /// Configure connection to use Informix default provider and connection string. /// </summary> /// <param name="builder">Instance of <see cref="LinqToDbConnectionOptionsBuilder"/>.</param> /// <param name="connectionString">Informix connection string.</param> /// <returns>The builder instance so calls can be chained.</returns> /// <remarks> /// <para> /// Default provider will be choosen by probing current folder for provider assembly and if it is not found, default to <c>IBM.Data.DB2</c> provider. /// This is not applicable to .NET Core applications as they always use <c>IBM.Data.DB2</c> provider. /// </para> /// </remarks> public static LinqToDbConnectionOptionsBuilder UseInformix(this LinqToDbConnectionOptionsBuilder builder, string connectionString) { return(builder.UseConnectionString(ProviderName.Informix, connectionString)); }
/// <summary> /// Configure connection to use Firebird provider and connection string. /// </summary> /// <param name="builder">Instance of <see cref="LinqToDbConnectionOptionsBuilder"/>.</param> /// <param name="connectionString">Firebird connection string.</param> /// <returns>The builder instance so calls can be chained.</returns> public static LinqToDbConnectionOptionsBuilder UseFirebird(this LinqToDbConnectionOptionsBuilder builder, string connectionString) { return(builder.UseConnectionString(ProviderName.Firebird, connectionString)); }
/// <summary> /// Configure connection to use Access OleDb provider and connection string. /// </summary> /// <param name="builder">Instance of <see cref="LinqToDbConnectionOptionsBuilder"/>.</param> /// <param name="connectionString">Access connection string.</param> /// <returns>The builder instance so calls can be chained.</returns> public static LinqToDbConnectionOptionsBuilder UseAccessOleDb(this LinqToDbConnectionOptionsBuilder builder, string connectionString) { return(builder.UseConnectionString(AccessTools.GetDataProvider(null), connectionString)); }
/// <summary> /// Configure connection to use Oracle default provider, dialect and connection string. /// </summary> /// <param name="builder">Instance of <see cref="LinqToDbConnectionOptionsBuilder"/>.</param> /// <param name="connectionString">Oracle connection string.</param> /// <returns>The builder instance so calls can be chained.</returns> /// <remarks> /// <para> /// By default Linq To DB tries to load managed version of Oracle provider. /// </para> /// <para> /// Oracle dialect will be choosen automatically: /// <list type="bullet"> /// <item>if <see cref="OracleTools.AutoDetectProvider"/> (default: <c>true</c>) enabled, Linq To DB will query server for version</item> /// <item>otherwise <see cref="OracleTools.DefaultVersion"/> (default: <see cref="OracleVersion.v12"/>) will be used as default dialect.</item> /// </list> /// </para> /// For more fine-grained configuration see <see cref="UseOracle(LinqToDbConnectionOptionsBuilder, string, OracleVersion)"/> overload. /// </remarks> public static LinqToDbConnectionOptionsBuilder UseOracle(this LinqToDbConnectionOptionsBuilder builder, string connectionString) { return(builder.UseConnectionString(ProviderName.Oracle, connectionString)); }
/// <summary> /// Configure connection to use <c>System.Data.Sqlite</c> SQLite provider and connection string. /// </summary> /// <param name="builder">Instance of <see cref="LinqToDbConnectionOptionsBuilder"/>.</param> /// <param name="connectionString">SQLite connection string.</param> /// <returns>The builder instance so calls can be chained.</returns> public static LinqToDbConnectionOptionsBuilder UseSQLiteOfficial(this LinqToDbConnectionOptionsBuilder builder, string connectionString) { return(builder.UseConnectionString(ProviderName.SQLiteClassic, connectionString)); }
/// <summary> /// Configure connection to use <c>Microsoft.Data.Sqlite</c> SQLite provider and connection string. /// </summary> /// <param name="builder">Instance of <see cref="LinqToDbConnectionOptionsBuilder"/>.</param> /// <param name="connectionString">SQLite connection string.</param> /// <returns>The builder instance so calls can be chained.</returns> public static LinqToDbConnectionOptionsBuilder UseSQLiteMicrosoft(this LinqToDbConnectionOptionsBuilder builder, string connectionString) { return(builder.UseConnectionString(ProviderName.SQLiteMS, connectionString)); }
/// <summary> /// Configure connection to use <c>MySqlConnector</c> MySql provider and connection string. /// </summary> /// <param name="builder">Instance of <see cref="LinqToDbConnectionOptionsBuilder"/>.</param> /// <param name="connectionString">MySql connection string.</param> /// <returns>The builder instance so calls can be chained.</returns> public static LinqToDbConnectionOptionsBuilder UseMySqlConnector(this LinqToDbConnectionOptionsBuilder builder, string connectionString) { return(builder.UseConnectionString(ProviderName.MySqlConnector, connectionString)); }
/// <summary> /// Configure connection to use PostgreSQL Npgsql provider, specific dialect and connection string. /// </summary> /// <param name="builder">Instance of <see cref="LinqToDbConnectionOptionsBuilder"/>.</param> /// <param name="connectionString">PostgreSQL connection string.</param> /// <param name="dialect">POstgreSQL dialect support level.</param> /// <returns>The builder instance so calls can be chained.</returns> public static LinqToDbConnectionOptionsBuilder UsePostgreSQL(this LinqToDbConnectionOptionsBuilder builder, string connectionString, PostgreSQLVersion dialect) { return(builder.UseConnectionString(PostgreSQLTools.GetDataProvider(dialect), connectionString)); }
/// <summary> /// Configure connection to use PostgreSQL Npgsql provider, default dialect and connection string. /// </summary> /// <param name="builder">Instance of <see cref="LinqToDbConnectionOptionsBuilder"/>.</param> /// <param name="connectionString">PostgreSQL connection string.</param> /// <returns>The builder instance so calls can be chained.</returns> /// <remarks> /// <para> /// PostgreSQL dialect will be choosen automatically: /// <list type="bullet"> /// <item>if <see cref="PostgreSQLTools.AutoDetectProvider"/> (default: <c>true</c>) enabled, Linq To DB will query server for version</item> /// <item>otherwise <see cref="PostgreSQLVersion.v92"/> will be used as default dialect.</item> /// </list> /// </para> /// For more fine-grained configuration see <see cref="UsePostgreSQL(LinqToDbConnectionOptionsBuilder, string, PostgreSQLVersion)"/> overload. /// </remarks> public static LinqToDbConnectionOptionsBuilder UsePostgreSQL(this LinqToDbConnectionOptionsBuilder builder, string connectionString) { return(builder.UseConnectionString(ProviderName.PostgreSQL, connectionString)); }
/// <summary> /// Configure connection to use specific SAP/Sybase ASE provider and connection string. /// </summary> /// <param name="builder">Instance of <see cref="LinqToDbConnectionOptionsBuilder"/>.</param> /// <param name="connectionString">SAP/Sybase ASE connection string.</param> /// <param name="useNativeProvider">if <c>true</c>, <c>Sybase.AdoNet45.AseClient</c> provider will be used; othwerwise managed <c>AdoNetCore.AseClient</c>.</param> /// <returns>The builder instance so calls can be chained.</returns> public static LinqToDbConnectionOptionsBuilder UseAse(this LinqToDbConnectionOptionsBuilder builder, string connectionString, bool useNativeProvider) { return(builder.UseConnectionString( SybaseTools.GetDataProvider(useNativeProvider ? ProviderName.Sybase : ProviderName.SybaseManaged), connectionString)); }
/// <summary> /// Configure connection to use Access ODBC provider and connection string. /// </summary> /// <param name="builder">Instance of <see cref="LinqToDbConnectionOptionsBuilder"/>.</param> /// <param name="connectionString">Access connection string.</param> /// <returns>The builder instance so calls can be chained.</returns> public static LinqToDbConnectionOptionsBuilder UseAccessODBC(this LinqToDbConnectionOptionsBuilder builder, string connectionString) { return(builder.UseConnectionString(ProviderName.AccessOdbc, connectionString)); }
/// <summary> /// Configure connection to use specific SQL Server provider, dialect and connection string. /// </summary> /// <param name="builder">Instance of <see cref="LinqToDbConnectionOptionsBuilder"/>.</param> /// <param name="connectionString">SQL Server connection string.</param> /// <param name="provider">SQL Server provider to use.</param> /// <param name="dialect">SQL Server dialect support level.</param> /// <returns>The builder instance so calls can be chained.</returns> public static LinqToDbConnectionOptionsBuilder UseSqlServer(this LinqToDbConnectionOptionsBuilder builder, string connectionString, SqlServerProvider provider, SqlServerVersion dialect) { return(builder.UseConnectionString(SqlServerTools.GetDataProvider(dialect, provider), connectionString)); }
/// <summary> /// Configure connection to use specific DB2 provider and connection string. /// </summary> /// <param name="builder">Instance of <see cref="LinqToDbConnectionOptionsBuilder"/>.</param> /// <param name="connectionString">DB2 connection string.</param> /// <param name="version">DB2 server version.</param> /// <returns>The builder instance so calls can be chained.</returns> public static LinqToDbConnectionOptionsBuilder UseDB2(this LinqToDbConnectionOptionsBuilder builder, string connectionString, DB2Version version) { return(builder.UseConnectionString(DB2Tools.GetDataProvider(version), connectionString)); }
/// <summary> /// Configure connection to use Oracle default provider, specific dialect and connection string. /// </summary> /// <param name="builder">Instance of <see cref="LinqToDbConnectionOptionsBuilder"/>.</param> /// <param name="connectionString">Oracle connection string.</param> /// <param name="dialect">Oracle dialect support level.</param> /// <returns>The builder instance so calls can be chained.</returns> /// <remarks> /// <para> /// By default Linq To DB tries to load managed version of Oracle provider. /// </para> /// </remarks> public static LinqToDbConnectionOptionsBuilder UseOracle(this LinqToDbConnectionOptionsBuilder builder, string connectionString, OracleVersion dialect) { return(builder.UseConnectionString(OracleTools.GetDataProvider(ProviderName.Oracle, null, dialect), connectionString)); }
//public static LinqToDbConnectionOptionsBuilder UseConnectionString<TConnection>(LinqToDbConnectionOptionsBuilder options, string connectionString) { // IDataProvider dataProvider ; // return options.UseConnectionString(dataProvider, connectionString); //} public static LinqToDbConnectionOptionsBuilder UseConnectionStringSettings(this LinqToDbConnectionOptionsBuilder options, IDataProvider dataProvider, ConnectionStringSettings connectionStringSettings) { //logger.Information($"{nameof(UseConnectionStringSettings)};Name:{connectionStringSettings.Name};Provider:{connectionStringSettings.ProviderName};CS:{connectionStringSettings.ConnectionString}"); return(options.UseConnectionString(dataProvider, connectionStringSettings.ConnectionString)); }