コード例 #1
0
 public MenuViewModel Build(Menu menu)
 {
     return new MenuViewModel()
       {
     MenuItems = this.handler.Storage.GetRepository<IMenuItemRepository>().FilteredByMenuId(menu.Id).Select(
       mi => new MenuItemViewModelBuilder(this.handler).Build(mi)
     )
       };
 }
コード例 #2
0
        public Menu Map(CreateOrEditViewModel createOrEdit)
        {
            Menu menu = new Menu();

              if (createOrEdit.Id != null)
            menu = this.handler.Storage.GetRepository<IMenuRepository>().WithKey((int)createOrEdit.Id);

              menu.Code = createOrEdit.Code;
              return menu;
        }
コード例 #3
0
 public MenuViewModel Build(Menu menu)
 {
     return new MenuViewModel()
       {
     Id = menu.Id,
     Name = this.handler.Storage.GetRepository<ILocalizationRepository>().FilteredByDictionaryId(menu.NameId).First().Value,
     MenuItems = this.handler.Storage.GetRepository<IMenuItemRepository>().FilteredByMenuId(menu.Id).Select(
       mi => new MenuItemViewModelBuilder(this.handler).Build(mi)
     )
       };
 }