public static IAccessRepository GetAuthorisationRepository(DatabaseEngineConstant databaseEngineOption, string connectionString) { switch (databaseEngineOption) { case DatabaseEngineConstant.MSSQLADODOTNET: { IAccessRepository accessRepository = new DbRepository.ADO.AccessRepositoryMsSql(connectionString); return(accessRepository); } default: { throw new InvalidOperationException("The option assigned to the AccessRepositoryFactory does " + "not exist in the factories internal collection"); } } }
public static IUserRepository GetUserRepository(DatabaseEngineConstant databaseEngineOption, string connectionString, IRepoTransaction repoTransaction) { switch (databaseEngineOption) { case DatabaseEngineConstant.MSSQLADODOTNET: { RepoTransactionMsSql repoTransactionMsSql = repoTransaction as RepoTransactionMsSql; if (repoTransactionMsSql == null) { string message = "Wrong Repo transaction type is injected into UserRepoFactory to be used with MSSQL."; throw new ApplicationException(message); } return(new UserRepositoryMsSql(connectionString, repoTransactionMsSql)); } default: { throw new InvalidOperationException("The option assigned to the UserRepositoryFactory does " + "not exist in the factories internal collection"); } } }