public void Read() { List <PersonDetailsDBHelper> lst = new List <PersonDetailsDBHelper>(); List <PersonDetails> person = new List <PersonDetails>(); foreach (var item in person) { lst.Add(new PersonDetailsDBHelper { Name = item.Name, Dob = item.Dob, Age = new DBHelper.Age(item.Age.Years) }); } PersonDetailsDBHelper personDB = new PersonDetailsDBHelper(); personDB.Read(); }
public void Read() { List <PersonDetailsDBHelper> lst = new List <PersonDetailsDBHelper>(); List <PersonDetails> person = new List <PersonDetails>(); foreach (var item in person) { lst.Add(new PersonDetailsDBHelper { Name = item.Name, Dob = item.Dob, Age = new DBHelper.Age(item.Age.Years) }); } PersonDetailsDBHelper personDB = new PersonDetailsDBHelper(); List <PersonDetailsDBHelper> list = PersonDetailsDBHelper.Read(); Console.WriteLine("PersonDetails table has the following entries :\n"); foreach (var item in list) { Console.WriteLine("Name : {0}\t Dob : {1}\t Age : {2}\n", item.Name, item.Dob, item.Age.Years); } }