// GET: Offer public ActionResult Index() { try { var offers = _offerAppService.GetOffers(); var model = Mapper.Map <IEnumerable <Offer>, IEnumerable <OfferViewModel> >(offers); return(View(model)); } catch (Exception e) { Console.WriteLine(e); throw; } }
// GET: api/OfferApi public IHttpActionResult Get() { try { var offers = _offerAppService.GetOffers().ToList(); if (!offers.Any()) { return(NotFound()); } return(Ok(offers)); } catch (Exception e) { return(InternalServerError(e)); } }