public override List<Value> Values
{
get
{
if (_values == null && shouldLoadLazily)
{
_values = _lazerLoader.LoadValues<Value>()
}
return _values;
}
set
{
throw new InvalidOperationException("Values are actually readonly- please set in constructor")
}
}
How to create immutable fields in c#