public async Task <IActionResult> GetLoanByUserId(Guid UserId) { try { if (UserId != null) { dynamic Loan = await _loan.GetLoanByUserId(UserId); if (Loan.Success == false) { return(NotFound(Loan)); } return(Ok(Loan)); } return(NotFound("Id field cannot be null")); } catch (Exception ex) { throw; } }