public ActionResult Index() { var isAdmin = User.IsInRole(Constants.AdminRole); var model = Mapper.Map <List <AdvertisementViewModel> >(isAdmin ? _adsService.GetAll() : _adsService.GetAllForUser(CurrentUserId)); return(View(model)); }