Inner Fields and Lazy Initialization in C#(stevesmithblog.com)

submitted by dpetersondpeterson(4397) 6 months, 24 days ago

Steve Smith shows us how we can use lazy properties without inner fields and without the fear of accidentally causing a NullReferenceException by accessing the inner field directly from code.

1 comment |category: |Views: 168

tags: another

new Add a live kick counter to your blog >> liveImage

You can even customize the image by choosing your own colors, and then clicking the button below to update the preview and the html code:

  • "Kick It" text
  • "Kick It" background
  • kick count text
  • kick count background
  • border

Simply copy and paste this HTML into your blog post.


Users who kicked this story:
Comments:

posted by NoldorinNoldorin(829) 6 months, 23 days ago 0

This is a nice example of a practical use of Lazy<T>. I personally haven't felt the need for it, though I've always understood the theory. This may just encourage me this little bit more.

Reply

information Login or create an account to comment on this story