示例#1
0
        public ICommandResult Delete(Guid id)
        {
            DeleteNurseCommand command = new DeleteNurseCommand();

            command.Id = id;
            var result = _handler.Handle(command);

            return(result);
        }
示例#2
0
        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));
        }