I would say that this also depends on what the setter of the Collection property does. Consider this:
public Collection Collection { get { return _collection; } set { _collection = value; Thread.Sleep( 1000 );
In this case, the assignment obj.Collection = obj.Collection ?? new Collection() obj.Collection = obj.Collection ?? new Collection() will be really expensive.
However, if you need to create a collection "on demand", usually use a similar template in the getter properties, for example:
public Collection Collection { get { return _collection ?? ( _collection = new Collection() ); } }
Danko durbić
source share