Пример #1
0
        public static MenuRoleMapVM GetDTO(MenuRoleMap menuRoleMap)
        {
            MenuRoleMapVM menuRoleMapVM = null;

            if (menuRoleMap != null)
            {
                menuRoleMapVM = new MenuRoleMapVM()
                {
                    Id       = menuRoleMap.Id,
                    IsActive = menuRoleMap.IsActive,
                    RoleVM   = RoleVM.GetDTO(menuRoleMap.Role),
                    MenuVM   = MenuVM.GetDTO(menuRoleMap.Menu)
                };
            }
            return(menuRoleMapVM);
        }
        public static MenuVM GetDTO(Menu menu)
        {
            MenuVM menuVM = null;

            if (menu != null)
            {
                menuVM = new MenuVM()
                {
                    Id         = menu.Id,
                    MenuName   = menu.MenuName,
                    Controller = menu.Controller,
                    Action     = menu.Action,
                    Order      = menu.Order,
                    IsParent   = menu.IsParent
                };
            }
            return(menuVM);
        }