J
Jason Cartwright
Apparently there is a bug in the Reflection methods used to retrieve
inherited members of an interface. A post almost a year ago detailed
the exact symptoms I am experiencing.
What I need to do is create a list of objects dynamically, using
Activator.CreateInstance(). I have a SqlDataReader that I am
iterating. I want to use the Properties defined on an interface to
retrieve the values from the reader. My classes have several inherited
properties that I want to ignore because the reader.GetOrdinal()
method throws an exception if the column doesn't exist.
My first interface contains about 30 properties and a derived
interface is used to define an additional property. Using the second,
derived interface, I only get the additional property when using the
GetProperties() method. This method works fine on my derived classes,
but it fails on my derived interfaces.
Anyway, I'm less than optimistic, but is there a way accomplish this?
Thanks,
Jason
inherited members of an interface. A post almost a year ago detailed
the exact symptoms I am experiencing.
What I need to do is create a list of objects dynamically, using
Activator.CreateInstance(). I have a SqlDataReader that I am
iterating. I want to use the Properties defined on an interface to
retrieve the values from the reader. My classes have several inherited
properties that I want to ignore because the reader.GetOrdinal()
method throws an exception if the column doesn't exist.
My first interface contains about 30 properties and a derived
interface is used to define an additional property. Using the second,
derived interface, I only get the additional property when using the
GetProperties() method. This method works fine on my derived classes,
but it fails on my derived interfaces.
Anyway, I'm less than optimistic, but is there a way accomplish this?
Thanks,
Jason