public EmployeesBLL(IOptions <AllConfiguration> configs) { ConfigReader configurations = new ConfigReader(configs); Dictionary <string, string> envArgs = EnvironmentHelper.Arguments; string passedEnvironment; if (envArgs != null && envArgs.Count > 0) { passedEnvironment = envArgs[EnvironmentHelper.ENV_BACKEND]; } else { passedEnvironment = ConfigReader.BackendDBType; } BackEndDB dbChoice = passedEnvironment == "COSMOS" ? BackEndDB.COSMOS : BackEndDB.SQL; this.backendDal = DALClientFactory.GetDBClient(dbChoice, configurations); }
public static ILabBackendDAL GetDBClient(BackEndDB dbChoice, ConfigReader configs) { ILabBackendDAL backendDAL; switch (dbChoice) { case BackEndDB.SQL: backendDAL = new EmployeeSQLDAL(); break; case BackEndDB.COSMOS: backendDAL = new EmployeeCOSMOSDAL(); break; default: backendDAL = new EmployeeSQLDAL(); break; } return(backendDAL); }
/// <summary> /// Initializes a new instance of the <see cref="UsersController"/> class. /// </summary> /// <param name="database">The database.</param> public UsersController(BackEndDB database) { _database = database; }
/// <summary> /// Initializes a new instance of the <see cref="ClassesController"/> class. /// </summary> /// <param name="database">The database.</param> public ClassesController(BackEndDB database) { _database = database; }