public async Task <ActionResult <Bond> > GetBond(int id) { var bond = await _repository.Get(id); if (bond == null) { return(NotFound()); } return(bond); }
// GET: Bonds/Details/5 /// <summary> /// Displays details of a bond /// </summary> /// <param name="id">ID of the chosen bond</param> /// <returns>View, containing details of a bond</returns> public async Task <IActionResult> Details(int?id) { if (id == null) { return(NotFound()); } var bond = await _repository.Get(id.Value); if (bond == null) { return(NotFound()); } return(View(bond)); }