public static List <SouvenirViewModel> SearchSouvenirName(string prefix) { List <SouvenirViewModel> result = new List <SouvenirViewModel>(); try { using (MarkomApplicationDBEntities db = new MarkomApplicationDBEntities()) { var res = db.spSouName(prefix); List <SouvenirViewModel> comList = res.Select(c => new SouvenirViewModel { id = c.id, name = c.name }).ToList(); result = comList; } } catch (Exception ex) { Message = ex.Message; } return(result); }