public static void ApplyChildsOrder(this MenuItemLiquidViewModel model)
 {
     if (model.Childs != null)
     {
         model.Childs = model.Childs.OrderBy(x => x.Order).ToList();
         model.Childs.ForEach(x => x.ApplyChildsOrder());
     }
 }
        private List <MenuItemLiquidViewModel> GetDecorated(List <MenuItemLiquidViewModel> items)
        {
            var list = new List <MenuItemLiquidViewModel>();

            items.ForEach(i =>
            {
                var decorated = new MenuItemLiquidViewModel();
                _decorators.ForEach(x =>
                {
                    decorated = x.Decorate(i);
                });
                if (i.Childs != null && i.Childs.Count > 0)
                {
                    decorated.Childs = GetDecorated(i.Childs);
                }
                list.Add(decorated);
            });
            return(list);
        }
 public override MenuItemLiquidViewModel Decorate(MenuItemLiquidViewModel wrappe)
 {
     return(new CategoryMenuitemDataDecorator(wrappe, _categories, _entities));
 }
 public CategoryMenuitemDataDecorator(MenuItemLiquidViewModel wrapee, ICategoryDataService dataservice, IEntityDataService entities) : base(wrapee)
 {
     _categories = dataservice;
     _entities   = entities;
 }