asp.net - How do I copy an inherited class properties to another class that inherits the same class? -
i have 3 classes:
- base
- primary
- secondary
primary , secondary inherit base. base has several properties.
in 1 of primary methods, create new secondary class instance. there way copy base properties primary secondary w/o having 1 one?
if 1 one, like:
secondary.property1 = primary.property1
secondary.property2 = primary.proprety2
i'm pretty sure there better way this.
you use library automapper. if code i'd map hand, unless sheer number of mappings made unwieldy.
Comments
Post a Comment