public IActionResult GetPuppyById(int id)
        {
            Puppy puppy = puppyDao.GetPuppy(id);

            if (puppy == null)
            {
                return(NotFound());
            }
            else
            {
                return(new JsonResult(puppy));
            }
        }
Esempio n. 2
0
        // GET: Puppies/Details/1
        public ActionResult Detail(int id)
        {
            try
            {
#if DEBUG
                _logger.LogInformation("GET Puppies/Details/{0} called", id); // TODO: Implement full logging solution when building production app
#endif
                return(View(_puppyDao.GetPuppy(id)));
            }
            catch (Exception ex)
            {
                _logger.LogError(ex, "{0} - {1}", "Puppies/Details/Id", ex.Message);
                return(View());
            }
        }
Esempio n. 3
0
        public IActionResult Detail(int id)
        {
            Puppy puppy = puppyDao.GetPuppy(id);

            return(View(puppy));
        }