Ejemplo n.º 1
0
        public ActionResult Index()
        {
            var isAdmin = User.IsInRole(Constants.AdminRole);
            var model   = Mapper.Map <List <AdvertisementViewModel> >(isAdmin
                ? _adsService.GetAll()
                : _adsService.GetAllForUser(CurrentUserId));

            return(View(model));
        }