I am inheriting from a class that has this property :
public bool isAuthorized
{
get { return _Authorized; }
set { _Authorized = value; }
}
I am trying to override this in the derived class, but it doesn’t recognise isAuthorized. Can someone help me with my syntax?
public override bool isAuthorized()
{
}
This is the error I get :
cannot override because 'CDBase.isAuthorized' is not a function
EDIT : So if I want the override to always set isAuthorized to true, I would use this syntax?
private bool _Authorized = false;
public override bool isAuthorized
{
get { return _Authorized; }
set { _Authorized = true; }
}
To set your value always to true you can simply write this code: