Skip to content

Commit

Permalink
Account for random whitespace in meal names
Browse files Browse the repository at this point in the history
  • Loading branch information
evanlihou committed Jan 11, 2024
1 parent 40e9f57 commit 08097dd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion FoodPicker.Infrastructure/Data/MealRatingRepository.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public ILookup<int, MealRating> GetPreviousRatingsForMeals(List<Meal> meals)
.Where(x => meals.Select(y => y.Name).Contains(x.Meal.Name)).AsEnumerable();

return ratings.ToLookup(x =>
meals.First(y => string.Equals(y.Name, x.Meal.Name, StringComparison.InvariantCultureIgnoreCase)).Id);
meals.First(y => string.Equals(y.Name.Trim(), x.Meal.Name.Trim(), StringComparison.InvariantCultureIgnoreCase)).Id);
}

public List<MealRating> GetPreviousRatingsForMeal(Meal meal)
Expand Down

0 comments on commit 08097dd

Please sign in to comment.