For example I have base class and I need a property that
will be calculated in derived classes.I have two variant (SomeProperty1
and SomeProperty2
):
public class BaseClass
{
public int SomeProperty1{get;set;}
public override int SomeProperty2{get;set;}
}
public class DerivedClass : BaseClass
{
public DerivedClass()
{
SomeProperty1 = 100;
}
public override int SomeProperty2
{
get
{
return 100;
}
}
}
The questions is what is the best way, SomeProperty1
or SomeProperty2
?