public ICommandResult Handle(PetCreateCommand command) { if (!command.Validate()) { var notifications = command.Notifications; return(new CommandResult(false, "PetCreateCommand", "Não foi possivel criar o pet" , notifications)); } var pet = new Pet(command.Name, command.OwnerID, command.Specie, command.Personality , command.Breed); _repository.Create(pet); return(new CommandResult(true, "PetCreateCommand", "Pet criado com sucesso", null)); }
public Pets SavePet(Pets pet) { return(_PetsRepo.Create(pet)); }