public DisplayAllVM SearchTestRegis(string txt, string centerid) { var data = repoOnSite.SearchTestRegis(txt, centerid); var result = new DisplayAllVM { TestRegistrations = data.Select(x => new TestRegistrationRespone { _id = x._id, Title = x.Title, FirstName = x.FirstName, LastName = x.LastName, SubjectCode = x.SubjectCode, SubjectName = x.SubjectName, ExamLanguage = x.ExamLanguage, VoiceLanguage = x.VoiceLanguage, RegDate = x.RegDate, RegDateString = x.RegDateString, ExpriedDate = x.ExpriedDate, SiteId = x.SiteId, CenterId = x.CenterId, ForPractice = x.ForPractice, ForTestSystem = x.ForTestSystem, Status = x.Status, PID = x.PID, ExamNumber = x.ExamNumber, ExamPeriod = x.ExamPeriod, AppointDate = x.AppointDate, Address = x.Address, MaxCount = x.MaxCount, CertData = new CertData { CertNo = x.CertData.CertNo, CertYear = x.CertData.CertYear, UserCode = x.CertData.UserCode } }).ToList(), }; return(result); }