Is there a built-in .NET method for getting all of the properties and values for an object?
- by Ben McCormack
Let's say I have:
public class Item
{
public string SKU {get; set; }
public string Description {get; set; }
}
....
Is there a built-in method in .NET that will let me get the properties and values for variable i of type Item that might look like this:
{SKU: "123-4556", Description: "Millennial Radio Classic"}
I know that .ToString() can be overloaded to provide this functionaility, but I couldn't remember if this was already provided in .NET.