/// <summary> /// Creates a new instance of the <see cref="OracleIdentityDbContext"/> class with /// the specified connections string and <see cref="IRolesTableCommands"/>. /// </summary> /// <param name="connectionString">The connection string to use when connecting to the Oracle database.</param> /// <param name="contextNomenclature"> /// Instance of <see cref="IContextNomenclature"/> containing the naming settings for each of the database objects. /// </param> /// <param name="enableCaseInsensitiveSearching"> /// A <see cref="bool"/> value indicating whether case insensitive searches should be used when querying the database. /// <para> /// When set to <c>true</c>, the following Oracle session parameters are set: /// <list type="bullet"> /// <item> /// <term>NLS_SORT</term> /// <description>"BINARY_CI"</description> /// </item> /// <item> /// <term>NLS_SORT</term> /// <description>"LINGUISTIC"</description> /// </item> /// </list> /// </para> /// </param> /// <exception cref="ArgumentNullException"> /// Thrown if the <paramref name="connectionString"/> parameter is /// <c>null</c>, an empty string, or only consists of white space characters. /// </exception> /// <seealso cref="http://docs.oracle.com/cd/B28359_01/server.111/b28320/initparams145.htm#REFRN10127"> /// Oracle Database Reference: NLS_SORT /// </seealso> /// <seealso cref="http://docs.oracle.com/cd/B28359_01/server.111/b28320/initparams135.htm#REFRN10117"> /// Oracle Database Reference: NLS_COMP /// </seealso> public OracleIdentityDbContext(string connectionString, IContextNomenclature contextNomenclature = null, bool enableCaseInsensitiveSearching = true) { if (String.IsNullOrWhiteSpace(connectionString)) { throw new ArgumentNullException(nameof(connectionString)); } this.connectionString = connectionString; ContextNomenclature = contextNomenclature ?? new OracleContextNomenclature(); this.enableCaseInsensitiveSearching = enableCaseInsensitiveSearching; RolesTableCommands = new RolesTableSqlCommands(ContextNomenclature.RolesTableNomenclature); UserClaimsTableCommands = new UserClaimsTableSqlCommands(ContextNomenclature.UserClaimsTableNomenclature); UserLoginsTableCommands = new UserLoginsTableSqlCommands(ContextNomenclature.UserLoginsTableNomenclature); UserRolesTableCommands = new UserRolesTableSqlCommands(ContextNomenclature.UserRolesTableNomenclature, ContextNomenclature.RolesTableNomenclature); UsersTableCommands = new UsersTableSqlCommands(ContextNomenclature.UsersTableNomenclature); }
/// <summary> /// Creates a new instance of the <see cref="OracleIdentityDbContext"/> class configured /// to use the provided connection string and <see cref="IContextNomenclature"/>. /// </summary> /// <param name="connectionString">The connection string to use when connecting to the Oracle database.</param> /// <param name="contextNomenclature"> /// The <see cref="IContextNomenclature"/> containing the information on the naming of the database objects. /// </param> /// <returns> /// A new instance of <see cref="OracleIdentityDbContext"/> configured to use /// the provided connection string and <see cref="IContextNomenclature"/>. /// </returns> public static IdentityDbContext Create(string connectionString, IContextNomenclature contextNomenclature = null) => new OracleIdentityDbContext(connectionString, contextNomenclature);