C
cwertman
Ok, I am HOPING this is simple and I am missing the quite in front of
my face answer I have not drunk enought caffine to answer.
I have a method that accepts objects of an unknown type and origin.
I am looking to "normailze" their storage in a 5 object database
layer.
2 questions
1)How do I iterate all the base types until I reach System.Object ?
So I have
ClassA
ClassB : ClassA (inherits classa)
ClassC : Class B (inherits classb)
So I pass the mehod an instance of ClassC
How do I get all the classes each derives from ?
I want the list of each item back up the chain so I should get
I have an arbitray class being passed in I have never seen before, so
I cant just call BaseTypes at the desired depth. (Or can I in a loop
somehow ?)
I need ,,,,,,
ClassC
ClassB
ClassA
System.Object
Question 2)
Now, how the heck do I iterate the BaseTypes and get the value that
exists witin ONLY the base the
So
ClassB has a property of FirstName and ClassC inherits ClassB
When I am iterating them I need only the Properties that exist in
ClassB (Not ClassC) and Not ClassA that ClassB inherits from)
Many thanks my brain is feeling like scramled eggs.
I wrote and ObjectDataBase layer for SQL2005 but I wrote it 2 years
ago and in VB I am wanting to convert it now to C# and tweak some
things like normailizing the storage of Base types....
http://www.objectgoo.com
my face answer I have not drunk enought caffine to answer.
I have a method that accepts objects of an unknown type and origin.
I am looking to "normailze" their storage in a 5 object database
layer.
2 questions
1)How do I iterate all the base types until I reach System.Object ?
So I have
ClassA
ClassB : ClassA (inherits classa)
ClassC : Class B (inherits classb)
So I pass the mehod an instance of ClassC
How do I get all the classes each derives from ?
I want the list of each item back up the chain so I should get
I have an arbitray class being passed in I have never seen before, so
I cant just call BaseTypes at the desired depth. (Or can I in a loop
somehow ?)
I need ,,,,,,
ClassC
ClassB
ClassA
System.Object
Question 2)
Now, how the heck do I iterate the BaseTypes and get the value that
exists witin ONLY the base the
So
ClassB has a property of FirstName and ClassC inherits ClassB
When I am iterating them I need only the Properties that exist in
ClassB (Not ClassC) and Not ClassA that ClassB inherits from)
Many thanks my brain is feeling like scramled eggs.
I wrote and ObjectDataBase layer for SQL2005 but I wrote it 2 years
ago and in VB I am wanting to convert it now to C# and tweak some
things like normailizing the storage of Base types....
http://www.objectgoo.com