Null coalescing operator for collection instantiation
private IList<Foo> _foo;
public IList<Foo> ListOfFoo
{ get { return _foo ?? (_foo = new List<Foo>()); } }
Written by Carlos Nasillo
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Tricks
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#