public static List <RoleViewModel> GetListRole(RoleViewModel paramSearch) { List <RoleViewModel> result = new List <RoleViewModel>(); using (var context = new MarkomApplicationDBEntities()) { var res = context.spRoleSearch(paramSearch.code, paramSearch.name, paramSearch.createDate2, paramSearch.createBy); List <RoleViewModel> comList = res.Select(c => new RoleViewModel { id = c.id, code = c.code, name = c.name, createDate = c.create_date, createBy = c.create_by }).ToList(); result = comList; } return(result); }