protected async ValueTask <ActionResult <TResult> > ExecuteRequest <TResult>(CacheableRequest <TResult> request) { HttpContext.AddCachePrefernces(request); var result = await ExecuteRequestImpl(request) .ConfigureAwait(false); HttpContext.AddFromCacheHeader(request); return(result); }
public async Task <ActionResult <IEnumerable <TransactionModel> > > GetTransactions([FromQuery] Paging paging, [FromQuery] Filter filter, [FromQuery] Order?order) { var query = new GetTransactionsQuery { Paging = paging, Filter = filter, Order = order }; HttpContext.AddCachePrefernces(query); var result = await Mediator.Send(query, HttpContext.RequestAborted) .ConfigureAwait(false); if (result.IsFailure) { return(result.Error.AsErrorActionResult()); } HttpContext.AddPaging(result.Value.Paging); HttpContext.AddFromCacheHeader(query); return(Ok(result.Value.Transactions)); }