示例#1
0
        public IActionResult DeleteConfirmed(Guid id)
        {
            if (ValidateEventAuthority(_eventAppService.GetById(id)))
            {
                return(RedirectToAction("MyEvents", _eventAppService.GetEventByOrganizer(OrganizerId)));
            }

            _eventAppService.Delete(id);
            return(RedirectToAction(nameof(Index)));
        }
示例#2
0
        /// <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:
        }
示例#3
0
        public IActionResult Delete([FromBody] Guid id)
        {
            try
            {
                _eventAppService.Delete(id);

                return(Ok());
            }
            catch (Exception ex)
            {
                return(BadRequest(ex.Message));
            }
        }
示例#4
0
 public async Task <bool> Handle(DeleteThrewEventsCommand request, CancellationToken cancellationToken)
 {
     return(await _eventAppService.Delete(request.Ids));
 }