Esempio n. 1
0
        public static List <MenuViewModel> SearchMenuStringCode(string prefix)
        {
            List <MenuViewModel> result = new List <MenuViewModel>();

            try
            {
                using (MarkomApplicationDBEntities db = new MarkomApplicationDBEntities())
                {
                    var res = db.spMenuCode(prefix);

                    List <MenuViewModel> codeList = res.Select(c => new MenuViewModel
                    {
                        id   = c.id,
                        code = c.code,
                    }).ToList();

                    result = codeList;
                }
            }
            catch (Exception ex)
            {
                Message = ex.Message;
            }
            return(result);
        }