public ActionResult Data(Cocktails id) { var cocktail = cocktailService.Cocktail(id); return(JsonContent(new { cocktail.Id, cocktail.Name, recipe = cocktail.Recipe.Select(ingredient => { var quantity = ingredient.Quantity.ToString("0.#") + (ingredient.IsDiscrete ? "" : " ml"); return new { id = ingredient.Ingredient, ingredient.Name, ingredient.IsOptional, quantity, quantityWords = ingredient.QuantityWords(), }; }), description = cocktail.Description(), image = ImageService.CocktailImage(cocktail, 200, "cocktail-image"), similar = cocktail.Similar.Select(CocktailSummary), })); }