I have a base class that is sealed and properties I want to be able to override if need be. These particular properties pull specific information off the local server, so not sure if I need to create a helper class that is not protected so I can override those particular properties.
My question is do I need to write a separate class for those properties or is there another way I can override the properties? Aside from removing my sealed modifier from my base class?
example:
public sealed class Base
{
public virtual string ServerInfo{ get; set = value; }
}
public class WantToBeChild
{
public override string ServerInfo { get; set = value;}
}
MarcPosted Mar 31, 2015, 9:24 AM
Pankaj Kumar ChoudharyPosted Mar 31, 2015, 9:21 AM
So either you can create a separate class that will contain all property .
now you can Inherit this class in other class ...
or you can use interface as you wish or feel comfortable ......
MarcPosted Mar 31, 2015, 8:45 AM
Pankaj Kumar ChoudharyPosted Mar 30, 2015, 8:43 PM
that you want to override without removing sealed modifier from base class...