Esempio n. 1
0
        private List <IngredientMeasurement> GetIngredientMeasurements(GetCocktailByIdDrink c)
        {
            var ingredients  = GetIngredients(c);
            var measurements = GetMeasurements(c);

            while (ingredients.Count > measurements.Count)
            {
                measurements.Add("");
            }

            return(ingredients.Select((ing, index) => new IngredientMeasurement(ing, measurements[index])).ToList());
        }
Esempio n. 2
0
 private List <string> GetMeasurements(GetCocktailByIdDrink c)
 {
     return(new List <string> {
         c.strMeasure1, c.strMeasure2, c.strMeasure3, c.strMeasure4, c.strMeasure5, c.strMeasure6, c.strMeasure7, c.strMeasure8, c.strMeasure9, c.strMeasure10, c.strMeasure11, c.strMeasure12, c.strMeasure13, c.strMeasure14, c.strMeasure15
     }.Where(i => i != "" && i != " " && i != "\n" && i != null).ToList());
 }
Esempio n. 3
0
 private List <string> GetIngredients(GetCocktailByIdDrink c)
 {
     return(new List <string> {
         c.strIngredient1, c.strIngredient2, c.strIngredient3, c.strIngredient4, c.strIngredient5, c.strIngredient6, c.strIngredient7, c.strIngredient8, c.strIngredient9, c.strIngredient10, c.strIngredient11, c.strIngredient12, c.strIngredient13, c.strIngredient14, c.strIngredient15
     }.Where(i => i != "" && i != " " && i != "\n" && i != null).ToList());
 }