public static List <EmployeeViewModel> SearchStringEmployeeNumber(string prefix) { List <EmployeeViewModel> result = new List <EmployeeViewModel>(); try { using (MarkomApplicationDBEntities db = new MarkomApplicationDBEntities()) { var res = db.spEmployeeNumber(prefix); List <EmployeeViewModel> comList = res.Select(c => new EmployeeViewModel { id = c.id, code = c.employee_number }).ToList(); result = comList; } } catch (Exception ex) { Message = ex.Message; } return(result); }