public async Task <IActionResult> GetTopUps([FromQuery] TopUpParameter topupsParameters) { var getAllTopUpsQuery = new GetAllTopUpQuery(topupsParameters); var result = await mediator.Send(getAllTopUpsQuery); if (result.Code == HttpStatusCode.OK) { Response.Headers.Add("X-Pagination", PagedList <Entity> .ToJson(result.Value as PagedList <Entity>)); } return(StatusCode((int)result.Code, result.Value)); }
/// <summary> /// Gets all TopUps. /// </summary> /// <param name="topUpParameter">The TopUp parameters.</param> /// <returns></returns> public async Task <PagedList <Entity> > GetAllTopUps(TopUpParameter topUpParameter) { { var gettopUpsParams = new object[] { new MySqlParameter("@p_IsForSingleTopUp", topUpParameter.IsForSingleTopUp), new MySqlParameter("@p_Value", topUpParameter.Value) }; var vendorsubscriptions = await FindAll("CALL SpSelectActiveTopUp(@p_IsForSingleTopUp, @p_Value)", gettopUpsParams).ToListAsync(); var mappedVendorSubscriptions = vendorsubscriptions.AsQueryable().ProjectTo <TopUpsResponse>(mapper.ConfigurationProvider); var sortedVendorSubscriptions = sortHelper.ApplySort(mappedVendorSubscriptions, topUpParameter.OrderBy); var shapedVendorSubscriptions = dataShaper.ShapeData(sortedVendorSubscriptions, topUpParameter.Fields); return(await PagedList <Entity> .ToPagedList(shapedVendorSubscriptions, topUpParameter.PageNumber, topUpParameter.PageSize)); } }
public async Task <IActionResult> GetTopUps([FromQuery] TopUpParameter topupsParameters) { var result = await topUpService.GetTopUps(topupsParameters); return(StatusCode((int)result.Code, result.Value)); }
/// <summary> /// Initializes a new instance of the <see cref="GetTopUpQuery"/> class. /// </summary> /// <param name="VendorSubscriptionId">The TopUp identifier.</param> public GetTopUpofVendorQuery(TopUpParameter vendorSubscriptionsParameter) { VendorSubscriptionsParameter = vendorSubscriptionsParameter; }
/// <summary> /// Initializes a new instance of the <see cref="GetAllTopUpQuery"/> class. /// </summary> /// <param name="vendorSubscriptionsParameter">The TopUp parameters.</param> public GetAllTopUpQuery(TopUpParameter vendorSubscriptionsParameter) { TopUpParameter = vendorSubscriptionsParameter; }
public Task <APIResponse> GetTopUps(TopUpParameter topupsParameters) { throw new NotImplementedException(); }