Ejemplo n.º 1
0
        public async Task <ActionResult <Bond> > GetBond(int id)
        {
            var bond = await _repository.Get(id);

            if (bond == null)
            {
                return(NotFound());
            }

            return(bond);
        }
Ejemplo n.º 2
0
        // 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));
        }