KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
Given a class with 35 fields and 2 objects with a certain number of different fields value. Is there an clever way to get a list<String> with the fields name where the object are as following? e.g. obj1.Name = "aaa"; obj1.LastName = "bbb"; obj1.Address = "xcs"; obj2.Name = "aaa"; obj2.LastName = "ccc"; obj2.Address = "jk"; objective: list<<String>String> containing 2 Strings LastName and Address I see reflection as the way to go but with 35 fields I am afraid it's too heavy. Any other idea, like linq?
Tags (comma-separated)
Save Edits
Cancel