public async Task <IActionResult> DeleteNotice(Guid noticeId) { var noticeEntity = await _noticeRepository.GetNoticeAsync(noticeId); if (noticeEntity == null) { return(NotFound()); } _noticeRepository.DeleteNotice(noticeEntity); await _noticeRepository.SaveAsync(); return(NoContent()); }
public IActionResult DeleteNotice(int id) { if (id == 0) { return(BadRequest()); } var noticeToDelete = _noticeRepository.GetNoticeById(id); if (noticeToDelete == null) { return(NotFound()); } _noticeRepository.DeleteNotice(id); return(NoContent());//success }