public async Task <ActionResult> Approve(int id, int?page) { await db.Create(new ApprovedDto { OfferId = id, StatusId = 4, UserId = _users.GetAspNetUsers().ToList() .Where(u => u.Email == User.Identity.GetUserName()) .First().Id }); if (_iStatusController.CheckStatus(id)) { OfferDto offer = _dbOffer.Get(id); offer.StatusesId = 4; await _dbOffer.Update(offer); } return(View("Index", _dbOffer.Get().ToPagedList(page ?? 1, 10))); }