public ActionResult DeleteConfirmed(int id) { Event eventEntity = _eventsRepository.GetWhere(x => x.ID == id).FirstOrDefault(); _eventsRepository.Delete(eventEntity); return(RedirectToAction("Index")); }
public bool Deletar(int ID) { try { return(_eventsRepository.Delete(ID)); } catch { return(false); } }
public async Task <IActionResult> Delete(int id) { try { await _eventsRepository.Delete(id); return(NoContent()); } catch (InvalidEventException) { return(NotFound()); } }
public IActionResult Delete(int eventToDeleteId) { try { repository.Delete(eventToDeleteId); } catch (ArgumentException) { return(NotFound()); } return(NoContent()); }
public OperationResult <bool> DeleteGame(int id) { var result = new OperationResult <bool>(); try { var Game = _gameRepo.Get(id); if (Game != null) { var events = _eventRepo.GetAll(id); foreach (var eventEntity in events) { _eventRepo.Delete(eventEntity); } _gameRepo.Delete(Game); var saveResult = _context.SaveChanges(); if (saveResult > 0) { result.Data = true; result.Status = eOperationStatus.Success; } else { result.Data = false; result.Status = eOperationStatus.GeneralError; } } else { result.Data = false; result.Status = eOperationStatus.NotFound; } } catch (Exception ex) { result.Data = false; result.Status = eOperationStatus.GeneralError; result.ExceptionMessage = ex.Message; } return(result); }
public void DeleteEvent(int id) { _eventsRepository.Delete(id); }
public void Delete(Guid id) { _eventsRepository.Delete(id); }
public IActionResult Delete(string id) { eventsRepo.Delete(id); return(RedirectToAction("Index")); }
public bool Delete(int id) { return(_IEventCategoryRepo.Delete(id)); }