C
Claire
Hi,
I have a virtual property getter/setter in my ancestor class.
It's overridden in inherited classes to validate that the value passed in is
within max/min bounds for that inherited class.
The constructors of the inherited classes have a parameter that initializes
this value.
eg
public childClass(int TimeMins)
{
this.TimeMins = TimeMins;
}
I'm being warned (by ReSharper) that I'm calling a virtual method from the
constructor.
Does anyone have any idea how I can get around this if its not good practice
please?
I have a virtual property getter/setter in my ancestor class.
It's overridden in inherited classes to validate that the value passed in is
within max/min bounds for that inherited class.
The constructors of the inherited classes have a parameter that initializes
this value.
eg
public childClass(int TimeMins)
{
this.TimeMins = TimeMins;
}
I'm being warned (by ReSharper) that I'm calling a virtual method from the
constructor.
Does anyone have any idea how I can get around this if its not good practice
please?