G
GG
I have an abstract class that looks like this
protected DateTime startDate = DateTime.Now;
protected DateTime endDate = DateTime.Now;
classConstructor(DateTime startDate,DateTime endDate)
{
this.startDate = startDate;
this.endDate = endDate;
}
The goal is when I inherit from this class to have access to startDate
and endDate.
I do not need to validate anything. Just use the protected fields as a
parameters. Also the dates will be used on other private methods in the
class.
Would I gain anything if I will add a property on the protected date
fields?
Thanks
protected DateTime startDate = DateTime.Now;
protected DateTime endDate = DateTime.Now;
classConstructor(DateTime startDate,DateTime endDate)
{
this.startDate = startDate;
this.endDate = endDate;
}
The goal is when I inherit from this class to have access to startDate
and endDate.
I do not need to validate anything. Just use the protected fields as a
parameters. Also the dates will be used on other private methods in the
class.
Would I gain anything if I will add a property on the protected date
fields?
Thanks