I’m using an API that has a “Member” class. I wish to extend this so i have create “MemberProfile” which inherits from “Member”
I have some issue creating the constructor for this class. I wish to something like the following
var member = Member.GetCurrentMember();
var memberProfile = new MemberProfile(member);
How would the constructor on MemberProfile look. Do i need to do some kind of cast?
I suggest adding a
Memberfield to theMemberProfileclass and initialize it in the constructor. Don’t inherit fromMember.If you really want to inherit from
Member, you’ll have to copy all the properties off the passed argument to the new instance manually.