public ActionResult MatchAggregate(string xmlguid, string menuitemguid)
        {
            var repo = new MatchedItemRepository_pp();
            var aggregate = new XmlMenuItem();

            if ( !string.IsNullOrEmpty(xmlguid))
            {
                aggregate = repo.GetXmlMenuItemWithIngredients(xmlguid);

                foreach (var xmlIngredient in aggregate.Ingredients)
                {
                    //need to get ingredient match, different from menu item ingredients
                    var xref = repo.GetIngredientCrossReference(xmlIngredient.ItemIngredientGuid);
                    if (xref != null && xref.ingredientsguid != null) // means there is no match
                        xmlIngredient.IngredientMatch = repo.GetMatchedIngredient(xref.ingredientsguid.ToString(),true);
            //
            //                    if ( xmlIngredient.IngredientMatch == null)
            //                        xmlIngredient.IngredientMatch = new IngredientAggregate();

                }
            }

            if (string.IsNullOrEmpty(menuitemguid))
            {
                //attempt to get from xref
                var xref = repo.GetMenuCrossReference(xmlguid);
                menuitemguid = xref.menuitemguid.ToString();
            }
            if (!string.IsNullOrEmpty(menuitemguid))
                aggregate.MenuItemMatch = repo.GetMenuItemWithIngredients(menuitemguid);

            return View(aggregate);
        }
        public ActionResult UpdateMenuItemsMatch(string xmlguid,string matchedGuid)
        {
            var repo = new MatchedItemRepository_pp();
            repo.UpdateMenuItemsXref(xmlguid, matchedGuid);

            var menuitem = repo.GetXmlMenuItem(xmlguid);
            menuitem.MenuItemMatch = repo.GetMenuItemWithIngredients(matchedGuid);
            return PartialView("GetMenuItemDetails", menuitem);
        }