public IActionResult DeleteConfirmed(Guid id) { if (ValidateEventAuthority(_eventAppService.GetById(id))) { return(RedirectToAction("MyEvents", _eventAppService.GetEventByOrganizer(OrganizerId))); } _eventAppService.Delete(id); return(RedirectToAction(nameof(Index))); }
/// <summary> /// Delete event /// </summary> /// <param name="id"></param> /// <returns></returns> public async Task <ActionResult> Delete(Guid id) { bool deleted = await _eventService.Delete(id); if (deleted) { return(Ok("Event deleted\\canceled !")); } return(BadRequest("Event cannot be deleted")); //TODO: }
public IActionResult Delete([FromBody] Guid id) { try { _eventAppService.Delete(id); return(Ok()); } catch (Exception ex) { return(BadRequest(ex.Message)); } }
public async Task <bool> Handle(DeleteThrewEventsCommand request, CancellationToken cancellationToken) { return(await _eventAppService.Delete(request.Ids)); }