public async Task <IEnumerable <TransactionType> > GetTransactionTypes(CancellationToken cancellationToken) { return(await _cacheProvider.GetOrSet(CacheType.DistributedMemoryCache, CacheConstants.TransactionTypes, async (cancellationToken) => await _transactionTypeService.GetTransactionTypes(cancellationToken), false, cancellationToken)); }
public async Task <ICollection <TransactionType> > GetTransactionTypes() { try { return(await _transactionTypeService.GetTransactionTypes()); } catch (Exception) { return(null); } }
public ActionResult GetTransactionTypes() { try { var response = _serv.GetTransactionTypes(); return(Ok(response)); } catch (Exception ex) { return(BadRequest($"Ocorreu um erro ao listar TransactionTypes: {ex.Message}")); } }