public async Task <IActionResult> Remove([FromBody][Required] RemoveEventRequest request) { var input = new RemoveEventInput(request.EventId); await _useCase.Execute(input); return(_presenter.ViewModel); }
public async Task Execute(RemoveEventInput input) { if (input is null) { throw new Exception(); } if (!await _repository.Exists(input.Id)) { _output.Error("There is no event with this ID."); return; } var deletedEvent = await _repository.Remove(input.Id); _output.Default(new RemoveEventOutput(deletedEvent)); }