public List <PersonInfo> GetInfo() { var per = from b in db.People select new { b.PersonLastName, b.PersonFirstName, b.PersonEmail, b.PersonPassWord, b.PersonAddresses, }; List <PersonInfo> info = new List <PersonInfo>(); foreach (Person pe in per) { PersonInfo p1 = new PersonInfo(); p1.lastName = pe.PersonLastName; p1.firstName = pe.PersonFirstName; p1.email = pe.PersonEmail; PersonInfo.Add(p1); } return(info); }