public IActionResult GetCodes([FromRoute] int id, [FromQuery] int page) { var sql = new SQL(_config.GetConnectionString("SQLConnnection")); var pageSize = Convert.ToInt32(_config.GetSection("Pagination")["PageNumber"]); var alphabet = _config.GetSection("Base26")["Alphabet"]; var codes = sql.GetCodes(id, alphabet, page, pageSize); var pages = sql.PageCount(id); return(Ok(new TableData(codes, pages, page))); }
public IActionResult GetCodes([FromRoute] int id, [FromQuery] int page) { var sql = new SQL(connectionString: _config.GetConnectionString("Storage")); var codeConverter = new CodeConverter(_config.GetSection("Base26")["Alphabet"]); var tableData = sql.GetCodes( campaignID: id, pageNumber: page, pageSize: Convert.ToInt32(_config.GetSection("Pagination")["PageSize"]), codeConverter: new CodeConverter(_config.GetSection("Base26")["Alphabet"])); return(Ok(tableData)); }
public IActionResult GetCodes([FromRoute] int id, [FromQuery] int page) { var sql = new SQL(connectionString: _config.GetConnectionString("Storage")); var file = new CloudReader(filePath: _config.GetSection("File")["SeedBlobUrl"]); var pageSize = Convert.ToInt32(_config.GetSection("Pagination")["PageNumber"]); var alphabet = _config.GetSection("Base26")["Alphabet"]; var codes = sql.GetCodes(id, page, pageSize, alphabet); var pages = sql.PageCount(id); return(Ok(new TableData(codes, pages, page))); }