List<ABC> lst = new List<ABC>()
{
new ABC { ID = 1, birthdate = DateTime.Now, name = "Vijay", joinDate = DateTime.Now },
new ABC { ID = 2, birthdate = DateTime.Now, name = "Sagar", joinDate = DateTime.Now },
new ABC { ID = 3, birthdate = DateTime.Now, name = "Dhaval", joinDate = DateTime.Now },
};
List<string> availablefield = new List<string>();
availablefield.Add("ID");
availablefield.Add("birthdate");
availablefield.Add("name");
What I have tried:
how to compare two list and getting data from first list but only getting data from which pass to second list.
I belongs this type of output
ID = 1, birthdate = DateTime.Now, name = "Vijay"
ID = 2, birthdate = DateTime.Now, name = "Sagar"