public XHRResponse <List <_Receipt> > ReadAllByDate(string userId, DateTime date) { XHRResponse <List <_Receipt> > result = new XHRResponse <List <_Receipt> >(); try { List <Receipt> receipts = _receiptRepository.GetAll(x => x.AccountId == userId && date.Date == x.TransactionDate.Date); result.Data = Mapper.Map <List <_Receipt> >(receipts); result.Succeeded = true; } catch (Exception ex) { result.Message = "Unable to get receipts."; result.Succeeded = false; } return(result); }
public IActionResult GetAll() { try { var user = _securityHelper.GetCurrentUser(HttpContext); var receipts = _repo.GetAll().Where(r => r.UserID == user.ID).OrderByDescending(r => r.ID); return(Ok(BuildResponse(receipts))); } catch { return(ReturnUserFriendlyError(Errors.Unknown)); } }
public async Task <ActionResult <Receipt[]> > GetAll() { try { var result = await _repo.GetAll(); if (result == null) { return(NotFound()); } return(Ok(result)); } catch (Exception e) { return(this.StatusCode(StatusCodes.Status500InternalServerError, $"Database failure {e.Message}")); } }
public IEnumerable GetAll_S() { return(_repository.GetAll()); }
public IEnumerable <Receipt> GetAll() { return(_receiptRepository.GetAll()); }
public async Task <IEnumerable <ReceiptVM> > GetAll() { return(await _receiptRepository.GetAll()); }
public IActionResult GetAll() { return(Ok(_receiptRepository.GetAll())); }
public IActionResult Get() { var model = _service.GetAll(); return(Ok(model)); }
public List <ReceiptViewModel> GetAll() { var result = receiptRepository.GetAll(); return(mapper.Map(result, new List <ReceiptViewModel>())); }