public async Task <IActionResult> Editad(int adid) { var advertisement = await _advertisementRepository.GetAdvertisementByAdId(adid); if (advertisement == null) { return(NotFound()); } else { if (_userService.GetUserId() == advertisement.Userid) { return(View(advertisement)); } else { return(RedirectToAction("managead", "Advertisement")); } } }