public ICommandResult Delete(Guid id) { DeleteNurseCommand command = new DeleteNurseCommand(); command.Id = id; var result = _handler.Handle(command); return(result); }
public ICommandResult Handle(DeleteNurseCommand command) { command.Validate(); if (command.Invalid) { AddNotifications(command); return(new CommandResult(false, command.Notifications.Messages(), command)); } _nurseRepository.Remove(command.Id); _uow.Commit(); return(new CommandResult(true, "Sucesso!", command)); }