Slight newbie question.
I have a base class for payments. All share the same properties apart from additional extras. One of the properties is a postUrl. In the base this is empty but in the child classes each one has its own url. This should not be allowed to be accessed from outside the classes and it fixed and should not change. How do I go about overriding the property in a child class?
e.g.
class paymentBase
{
public int transactionId {get;set;}
public string item {get;set;}
protected virtual postUrl = String.empty; // can't be accessed from outside inheritance / public / protected?
public void payme();
}
class paymentGateWayNamePayment : paymentBase
{
protected override postUrl {
get { return "http://myurl.com/payme"; }
}
}
How would I go about doing this?
Thanks in advance
You should be able to accomplish it if you make your
postUrlan actual virtual property, like this: