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

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

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

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