views:

36

answers:

1

Sup Guys,

On my Bussiness Layer, I have something like

Dim object as New ExampleObject

Where ExampleObject inherits BaseExampleObject.

I want to know how can I access ExampleObject Properties by reflection on my BaseExampleObject.

Something like:

MyBase.GetType.GetProperty("PropertyName").GetValue(mybase.gettype, Nothing)

Of course thats not going to work because this is not an instance of an object and if I instantiate a new object, I'll lose the reference from my Bussiness Layer.

Anyone got a hint?

Thanks

A: 

Hi, cast your BaseExampleObject to ExampleObject:

BaseExampleObject b;
b = new ExampleObject();
((ExampleObject)b).Something();
Axarydax
BaseExampleObject is a mustinherit class wich i got some common methods for a lot of classes (thats why i need to access their propreties thru reflection), and also, cast an already inherited object is kinda a WOP.
Alex