This commit is contained in:
2020-01-27 18:41:14 +00:00
parent 20728c0224
commit 3b2189de01
3 changed files with 7 additions and 6 deletions

View File

@@ -62,7 +62,7 @@ namespace AyaNova.Api.Controllers
try
{
ApiPagedResponse pr = await DataListFetcher.GetResponse(listOptions.DataListKey, ct, Url, nameof(List), listOptions, UserId, UserRoles);
ApiPagedResponse pr = await DataListFetcher.GetResponseAsync(listOptions.DataListKey, ct, Url, nameof(List), listOptions, UserId, UserRoles);
return Ok(new ApiOkWithPagingResponse(pr));
}
catch (System.UnauthorizedAccessException)

View File

@@ -13,7 +13,7 @@ namespace AyaNova.DataList
{
internal static class DataListFetcher
{
internal static async Task<ApiPagedResponse> GetResponse(string DataListKey, AyContext ct, IUrlHelper Url,
internal static async Task<ApiPagedResponse> GetResponseAsync(string DataListKey, AyContext ct, IUrlHelper Url,
string routeName, ListOptions listOptions, long UserId, AuthorizationRoles UserRoles)
{
@@ -117,11 +117,11 @@ namespace AyaNova.DataList
//QUERY THE DB
using (var command = ct.Database.GetDbConnection().CreateCommand())
{
ct.Database.OpenConnection();
await ct.Database.OpenConnectionAsync();
//GET DATA RETURN ROWS
command.CommandText = qDataQuery;
using (var dr = command.ExecuteReader())
using (var dr = await command.ExecuteReaderAsync())
{
while (dr.Read())
{
@@ -155,7 +155,7 @@ namespace AyaNova.DataList
if (f.SqlIdColumnName != null)//skip over df column id, it's not there
{
if (!dr.IsDBNull(nCurrentColumnPointer))
if (!await dr.IsDBNullAsync(nCurrentColumnPointer))
AyaField.i = dr.GetInt64(nCurrentColumnPointer);
nCurrentColumnPointer++;
@@ -168,7 +168,7 @@ namespace AyaNova.DataList
//GET TOTAL RECORD COUNT
command.CommandText = qTotalRecordsQuery;
using (var dr = command.ExecuteReader())
using (var dr = await command.ExecuteReaderAsync())
{
if (dr.Read())
{