public IActionResult Delete(int advertId) { advertRepository.DeleteAdvert(advertId); flashMessage.Confirmation("Ogłoszenie zostało usunięte"); return(RedirectToAction(nameof(AdvertController.List), nameof(AdvertController).Replace("Controller", ""))); }
public async Task <IHttpActionResult> DeleteAdvert(int id) { Advert advert = await _advertRepository.GetAdvertByID(id); if (advert == null) { return(NotFound()); } _advertRepository.DeleteAdvert(id); await _advertRepository.SaveAsync(); return(Ok()); }
public IActionResult Delete(int id) { _advertRepository.DeleteAdvert(id); return(new OkResult()); }
public bool DeleteAdvert(int id, string userId) { return(_advertRepository.DeleteAdvert(id, userId)); }