Example #1
0
        public IActionResult Details(int id)
        {
            CakesDetailsViewModel cakesdetailsviewmodel = new CakesDetailsViewModel();
            var cake = _CakeRepository.getCakebyId(id);

            cakesdetailsviewmodel.CakeId      = cake.CakeId;
            cakesdetailsviewmodel.Name        = cake.Name;
            cakesdetailsviewmodel.Description = cake.Description;
            cakesdetailsviewmodel.Price       = cake.Price;
            cakesdetailsviewmodel.ImageUrl    = cake.ImageUrl;

            if (cakesdetailsviewmodel == null)
            {
                return(NotFound());
            }
            else
            {
                return(View(cakesdetailsviewmodel));
            }
        }