J
Joe
It seems that if given an instance of a class, there should be some
inherited property (from "object" perhaps) that is a collection of the
properties of that instance.
I know you can get to it by using reflection, but that seems to be a
convoluted and costly way to go about doing it, since I have the
instance already.
For example:
public class Foo
{
public string Name;
public int Age;
public Foo()
{
// potential code that I'm hoping exists...
foreach (PropertyInfo p in this.[?????])
{
// whatever
}
}
}
Again, I know how to do this with reflection. I'm just looking for a
more efficient (and hopefully more straight-forward) way to do it.
inherited property (from "object" perhaps) that is a collection of the
properties of that instance.
I know you can get to it by using reflection, but that seems to be a
convoluted and costly way to go about doing it, since I have the
instance already.
For example:
public class Foo
{
public string Name;
public int Age;
public Foo()
{
// potential code that I'm hoping exists...
foreach (PropertyInfo p in this.[?????])
{
// whatever
}
}
}
Again, I know how to do this with reflection. I'm just looking for a
more efficient (and hopefully more straight-forward) way to do it.