private void AddAnimal() { Console.Clear(); string animalCategoryName; string animalDietPlanName; IEnumerable <Category> categories = Query.GetCategories(); IEnumerable <DietPlan> dietPlans = Query.GetDietPlans(); do { animalCategoryName = UserInterface.GetStringData("category/breed", "the name of the animal's"); } while (!UserInterface.CheckIfValueExistsInTable <string>(categories.Select(a => a.Name.ToLower()), animalCategoryName.ToLower(), "Categories")); do { animalDietPlanName = UserInterface.GetStringData("diet plan", "the name of the animal's"); } while (!UserInterface.CheckIfValueExistsInTable <string>(dietPlans.Select(a => a.Name.ToLower()), animalDietPlanName.ToLower(), "Diet Plans")); Animal animal = new Animal(); animal.CategoryId = Query.GetCategoryId(animalCategoryName); animal.Name = UserInterface.GetStringData("name", "the animal's"); animal.Age = UserInterface.GetIntegerData("age", "the animal's"); animal.Demeanor = UserInterface.GetStringData("demeanor", "the animal's"); animal.KidFriendly = UserInterface.GetBitData("the animal", "child friendly"); animal.PetFriendly = UserInterface.GetBitData("the animal", "pet friendly"); animal.Weight = UserInterface.GetIntegerData("the animal", "the weight of the"); animal.DietPlanId = Query.GetDietPlanId(animalDietPlanName); Query.AddAnimal(animal); }