public ActionResult <pagedUserData> GetUsers(UrlQuery urlQuery)
        {
            string tableName = "Users";

            _databasename = _context.Database.GetDbConnection().Database;
            tableName     = AdjustDBEntityNameForProvider(tableName);
            pagedUserData data       = new pagedUserData();
            var           pageNumber = Convert.ToInt32(urlQuery.PageNumber);

            data.recordCount = _context.Users.Count();
            string sql = GenerateSql(urlQuery, tableName, data);

            data.records = _context.Users.FromSqlRaw(sql).ToList();
            return(data);
        }
        private string GenerateSql(UrlQuery urlQuery, string tableName, pagedUserData data)
        {
            var provider = _configuration.GetSection("TraumaRegistrySettings")["dbProvider"];

            switch (provider)
            {
            case "sqlserver":
                return(sqlserver(urlQuery, tableName));

            case "postgres":
                return(postgres(urlQuery, tableName));

            case "mysql":
                return(mysql(urlQuery, tableName));

            default:
                throw new Exception(string.Format("DB Provider {0} not supported.", provider));
            }
        }