public void Update(Pet pet) { pet.Name = name; pet.Location = loc("location", location).ToString(); pet.Type = loc("type", type).ToString(); pet.Sex = PetUtils.ParseSex(gender); pet.Breed = breed; pet.BreedSecondary = breed_secondary; pet.Age = age_actual; pet.Lifestyle = lifestyle; pet.Training = loc("training", training).ToString(); pet.Status = parseStatus(); var actualAnimals = animalHandling(); var currentAnimals = pet.OtherAnimals; foreach (string animal in currentAnimals.Except(actualAnimals)) { pet.RemoveOtherAnimal(animal); } foreach (string animal in actualAnimals.Except(currentAnimals)) { pet.AddOtherAnimal(animal); } }
public void Update(Pet pet) { pet.Name = name; pet.Location = loc("location", shelter).ToString(); pet.Type = loc("type", animal_type).ToString(); pet.Sex = PetUtils.ParseSex(sex); pet.Breed = breedPrimary; pet.BreedSecondary = breedSecondary; pet.Age = formattedAge(); pet.Lifestyle = "Unknown"; pet.Training = "Unknown"; pet.Status = parseStatus(); }