You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In other words we have a read-only property with a backing field that we want to only evaluate once and keep in memory (classic lazy acquisition).
But now that we have Auto-Property Initializers, which automatically create a backing field, couldn't we simply extend this concept to a lazily acquired Auto-Property - in other words, only carry out the initialization when the property is first accessed.
I am not sure about the syntax, but how about something along these lines?
In lots of classes we do something like this:
In other words we have a read-only property with a backing field that we want to only evaluate once and keep in memory (classic lazy acquisition).
But now that we have Auto-Property Initializers, which automatically create a backing field, couldn't we simply extend this concept to a lazily acquired Auto-Property - in other words, only carry out the initialization when the property is first accessed.
I am not sure about the syntax, but how about something along these lines?
It would tidy up lots of classes immensely.
The text was updated successfully, but these errors were encountered: