public Lender GetMostHighestLender() { var allLoans = _reportsRepository.GetAll(); Loan maxLoan = allLoans.MaxBy(loan => loan.LoanBalance).FirstOrDefault(); Lender maxLender = new Lender() { Name = "", Balance = 0 }; if (maxLoan != null) { maxLender = _lenderRepository.GetById(maxLoan.LenderId); maxLender.Balance = maxLoan.LoanBalance; } return(maxLender); }
public IActionResult GetAll([FromQuery] Helpers.Pager query) { var pager = _mapper.Map <Domain.Helpers.Pager>(query); var records = _reportsRepository.GetAll(pager); var items = _mapper.Map <List <Models.ReportsView.Reports> >(records); var result = new Models.ReportsView { Items = items, TotalItems = pager.TotalItems }; return(Ok(result)); }
public List <tblReport> GetAll() { return(_reportsRepository.GetAll()); }
public IEnumerable <UserReport> GetAll(DateTime dateFrom, DateTime dateTo) { return(_reportsRepository.GetAll(dateFrom, dateTo)); }
public IHttpActionResult GetAll() { IEnumerable <Report> reports = _reportsRepository.GetAll(); return(Ok(reports.Select(r => r.MapToViewModel()))); }