Be Lazy, but be ware of initialization exception
.Net 4 introduced the Lazy<T> type which allows you to create an object that can be lazily initialized so that you can delay the creation of large objects, for instance. However, if your initialization logic has the potential to except at runtime (e.g. time out exceptions reading from some external data source) then you should …
Be Lazy, but be ware of initialization exception Read More »