/// <summary> /// Gets the Adjunct Amount Elements /// </summary> object GetAdjuctAmountElements(RecipeAdjunct recipeAdjunct) { // Weight use KG, Liquid use L switch (recipeAdjunct.Unit.ToLower()) { case "each": return(new[] { new XElement("AMOUNT", recipeAdjunct.Amount), new XElement("AMOUNT_IS_WEIGHT", "false") }); case "lb": return(new[] { new XElement("AMOUNT", RecipeUnitConverter.ConvertPoundsToKilograms(recipeAdjunct.Amount)), new XElement("AMOUNT_IS_WEIGHT", "true") }); case "oz": return(new[] { new XElement("AMOUNT", RecipeUnitConverter.ConvertOuncesToKilograms(recipeAdjunct.Amount)), new XElement("AMOUNT_IS_WEIGHT", "true") }); case "floz": return(new[] { new XElement("AMOUNT", RecipeUnitConverter.ConvertFluidOuncesToLiters(recipeAdjunct.Amount)), new XElement("AMOUNT_IS_WEIGHT", "false") }); case "gal": return(new[] { new XElement("AMOUNT", RecipeUnitConverter.ConvertGallonsToLiters(recipeAdjunct.Amount)), new XElement("AMOUNT_IS_WEIGHT", "false") }); case "pt": return(new[] { new XElement("AMOUNT", RecipeUnitConverter.ConvertPintsToLiters(recipeAdjunct.Amount)), new XElement("AMOUNT_IS_WEIGHT", "false") }); case "qt": return(new[] { new XElement("AMOUNT", RecipeUnitConverter.ConvertQuartsToLiters(recipeAdjunct.Amount)), new XElement("AMOUNT_IS_WEIGHT", "false") }); case "tbsp": return(new[] { new XElement("AMOUNT", RecipeUnitConverter.ConvertTbspToLiters(recipeAdjunct.Amount)), new XElement("AMOUNT_IS_WEIGHT", "false") }); case "tsp": return(new[] { new XElement("AMOUNT", RecipeUnitConverter.ConvertTspToLiters(recipeAdjunct.Amount)), new XElement("AMOUNT_IS_WEIGHT", "false") }); case "kg": return(new[] { new XElement("AMOUNT", recipeAdjunct.Amount), new XElement("AMOUNT_IS_WEIGHT", "true") }); case "l": return(new[] { new XElement("AMOUNT", recipeAdjunct.Amount), new XElement("AMOUNT_IS_WEIGHT", "false") }); case "ml": return(new[] { new XElement("AMOUNT", recipeAdjunct.Amount * 1000), new XElement("AMOUNT_IS_WEIGHT", "false") }); default: return(null); } }