public async Task <IActionResult> Index() { var jobOffers = await _jobOfferService.GetAllOffers(); var vms = _mapper.Map <IList <JobOfferViewModel> >(jobOffers); ViewData["JobOfferCount"] = vms.Count; if (!await _authService.IsSignedIn(HttpContext.User)) { return(View(vms)); } var user = await _authService.GetSignedUser(User); foreach (var offer in vms) { offer.CanEdit = await _jobOfferService.CanUserEditOffer(user.Id, offer.JobOfferId); } return(View(vms)); }