N
nautic20
Hey C# people,
I'm just trying to assign two (unlike) child objects which both derive
from the same base class equal to each other...
Example :
BaseClass tempObj = child1 as BaseClass;
child2 = (child2)tempObj;
Of course this throws an exception because child2 doesn't have all the
same properties as child1. I know I should map one to the other but
the BaseClass alone has 100+ properties and each child has about a
dozen themselves.
I KNOW there is a System method that can convert child1 to child2 by
simply copying the properties from one class and assigning them to the
same-name properties of the other; I've done it before. I JUST CAN'T
REMEMBER WHAT THE NAME OF THAT NAMESPACE.CLASS.METHOD WAS!!!. I'm
praying one of you guys knows because I'm not trying to get carpel-
tunnel syndrome!
If one of you all would enlighten me I PROMISE I'll instantly mail it
to my gmail account and NEVER forget it!!!!!!!!!!!!!!!
Thanks to all!
I'm just trying to assign two (unlike) child objects which both derive
from the same base class equal to each other...
Example :
BaseClass tempObj = child1 as BaseClass;
child2 = (child2)tempObj;
Of course this throws an exception because child2 doesn't have all the
same properties as child1. I know I should map one to the other but
the BaseClass alone has 100+ properties and each child has about a
dozen themselves.
I KNOW there is a System method that can convert child1 to child2 by
simply copying the properties from one class and assigning them to the
same-name properties of the other; I've done it before. I JUST CAN'T
REMEMBER WHAT THE NAME OF THAT NAMESPACE.CLASS.METHOD WAS!!!. I'm
praying one of you guys knows because I'm not trying to get carpel-
tunnel syndrome!
If one of you all would enlighten me I PROMISE I'll instantly mail it
to my gmail account and NEVER forget it!!!!!!!!!!!!!!!
Thanks to all!