Esempio n. 1
0
        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);
        }
Esempio n. 2
0
        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);
        }
Esempio n. 3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="UsersController"/> class.
 /// </summary>
 /// <param name="database">The database.</param>
 public UsersController(BackEndDB database)
 {
     _database = database;
 }
Esempio n. 4
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ClassesController"/> class.
 /// </summary>
 /// <param name="database">The database.</param>
 public ClassesController(BackEndDB database)
 {
     _database = database;
 }