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;}
}

Pankaj Kumar ChoudharyRank #80 · 24.4K reputationPosted Mar 30, 2015, 4:43 PM EDT
that you want to override without removing sealed modifier from base class...
Marc176 reputationPosted Mar 31, 2015, 4:45 AM EDT
Pankaj Kumar ChoudharyRank #80 · 24.4K reputationPosted Mar 31, 2015, 5:21 AM EDT
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 ......
Marc176 reputationPosted Mar 31, 2015, 5:24 AM EDT