Ejemplo n.º 1
0
        public static List <MenuViewModel> GetListMenu(MenuViewModel paramSearch)
        {
            List <MenuViewModel> result = new List <MenuViewModel>();

            using (var context = new MarkomApplicationDBEntities())
            {
                var res = context.spMenuSearch(paramSearch.code, paramSearch.name, paramSearch.createDate2, paramSearch.createBy);

                List <MenuViewModel> menuList = res.Select(c => new MenuViewModel
                {
                    id         = c.id,
                    code       = c.code,
                    name       = c.name,
                    createDate = c.create_date,
                    createBy   = c.create_by
                }).ToList();

                result = menuList;
            }

            return(result);
        }