示例#1
0
        public ICommandResult Handle(DeleteGenderCommand command)
        {
            if (command.Id.ToString().Length == 0)
            {
                AddNotification("Id", "Identificador inválido!");
            }

            if (Invalid)
            {
                return(new CommandResult(false, "Erro ao deletar gênero!", Notifications));
            }

            bool result = _repository.Delete(command.Id);

            if (!result)
            {
                return(new CommandResult(false, "Erro ao deletar gênero!", Notifications));
            }

            return(new CommandResult(true, "Gênero deletado com sucesso!"));
        }
示例#2
0
 public ICommandResult Delete(DeleteGenderCommand command)
 {
     return(_handler.Handle(command));
 }