public List <Email_serviceViewModel> GetallEmail() { using (var clinicrepo = new EmailRepository()) { return(clinicrepo.GetAllEmail().Select(x => new Email_serviceViewModel() { Body = x.Body, Cc = x.Cc, Subject = x.Subject, To = x.To, Bcc = x.Bcc, StaffName = x.StaffName, emailID = x.emailID, }).ToList()); } }