Example #1
0
        public IUsersContext CreateContext()
        {
            if (_usersContextTypeByDatabaseEngine.TryGetValue(_databaseEngine, out Type contextType))
            {
                return(Activator.CreateInstance(contextType, _connectionStringsProvider.GetConnectionString()) as IUsersContext);
            }

            throw new InvalidOperationException(
                      $"Cannot create an IUsersContext for database type {_databaseEngine.DisplayName}");
        }
Example #2
0
 public SqlServerIdentityContext(IAdminDatabaseConnectionStringProvider connectionStringsProvider)
     : base()
 {
     _connectionString = connectionStringsProvider.GetConnectionString();
 }