private string FormatSingleDish(MealRequest request, DishRequestItem item) { var dishes = AvailableMeals[request.MealRequestType].Dishes; var allowed = AvailableMeals[request.MealRequestType].AllowedMultiple; return DecodeDish(item.Offset, dishes) + DishSuffix(allowed, item); }
public string DescribeRequest(MealRequest request) { return request.Items .Select(i => FormatSingleDish(request, i)) .TakeWhileInclusive(s => !s.Contains("error")) .Join(", "); }