public ActionResult ViewGift(int id) { var gift = _giftService.Get(id); if (gift == null) { throw new HttpException(404, "Category not found"); } var model = Mapper.Map <GiftViewModel>(gift); if (CurrentUser != null) { model.ViewsCount = _giftService.ChangeViewsCount(gift.Id, CurrentUser.Id); model.DoesUserHaveWishlists = _giftService.HaveWishlists(CurrentUser.Id); } return(View(model)); }