public SchoolPerformanceController(ILogger <SchoolPerformanceController> logger,
                                           IHttpClientFactory clientFactory,
                                           IConfiguration configuration,
                                           SchoolsSqlDataService sqlService,
                                           SchoolsSimDataService simService,
                                           SchoolEFDataService efService)
        {
            _logger        = logger;
            _clientFactory = clientFactory;
            _sqlService    = sqlService;
            _simService    = simService;
            _efService     = efService;
            _configuration = configuration;

            try
            {
                string useSIM = _configuration.GetValue <string>("UseSIM");
                if (useSIM == "1")
                {
                    UseSim = true;
                }

                string useEF = _configuration.GetValue <string>("UseEF");
                if (useEF == "1")
                {
                    UseEF = true;
                }

                string allowEF = _configuration.GetValue <string>("AllowEF");
                if (allowEF == "1")
                {
                    AllowEF = true;
                }

                string allowDapper = _configuration.GetValue <string>("AllowDapper");
                if (allowDapper == "1")
                {
                    AllowDapper = true;
                }

                if ((UseSim == false) && (UseEF == false) && (AllowDapper == true))
                {
                    UseDapper = true;
                }

                string maxPage = configuration.GetValue <string>("MaxPage");
                MaxPage = Convert.ToInt32(maxPage);
            }
            catch (Exception e)
            {
                logger.LogError("Exception loading configuration", e);
            }

            _support = new CommonControllerSupport();
        }
        public SchoolModelController(ILogger <SchoolModelController> logger,
                                     IHttpClientFactory clientFactory,
                                     IConfiguration configuration,
                                     SchoolsSqlDataService sqlService,
                                     SchoolEFDataService efService,
                                     SchoolsSimDataService simService)
        {
            _logger        = logger;
            _clientFactory = clientFactory;

            try
            {
                string useSim = configuration.GetValue <string>("UseSIM");
                if (useSim == "1")
                {
                    _dataService = simService;
                }
                else
                {
                    string useEF = configuration.GetValue <string>("UseEF");
                    if (useEF == "1")
                    {
                        _dataService = efService;
                    }
                    else
                    {
                        _dataService = sqlService;
                    }
                }

                string maxPage = configuration.GetValue <string>("MaxPage");
                MaxPage = Convert.ToInt32(maxPage);
            }
            catch (Exception e)
            {
                logger.LogError("Exception loading configuration", e);
            }

            _support = new CommonControllerSupport();
        }