Beispiel #1
0
        public async Task <ActionResult> GetLoan(int id)
        {
            try
            {
                if (await _repo.GetLoanById(id) is CoreLoan loan)
                {
                    var transformed = ApiMapper.MapLoan(loan);

                    return(Ok(transformed));
                }
            }
            catch (NullReferenceException)
            {
                return(NotFound($"No loan with the id of {id}."));
            }
            return(Ok("There is no loan."));
        }