andreas_rafn
asked on
Is it possible to rename an inherited property in VB.NET?
In an application I have a generic parent class representing a database entity. One of its properties is an id (generic). In a child class that inherits this, I would love to rename the inherited Id property to SuKey instead, refering to a specific id (reducing the possibility of mistakes), as some database entities have multiple ids (merged from multiple systems). The renamed property should still be exactly the same as if not renamed.
I know that an option is simply creating a SuKey property referring to the inherited id property. However that would create multiple properties doing the same (SuKey and Id).
Another option I guess is letting the Id field be protected in the base class, and then for each class inheriting it, select its name and/or if it should be publicly accessible in the child class.
Any input?
I know that an option is simply creating a SuKey property referring to the inherited id property. However that would create multiple properties doing the same (SuKey and Id).
Another option I guess is letting the Id field be protected in the base class, and then for each class inheriting it, select its name and/or if it should be publicly accessible in the child class.
Any input?
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
ASKER