<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <title>Snipplr</title>
    <description>Recent snippets posted on Snipplr.com</description>
    <link>https://snipplr.com/</link>
    <lastBuildDate>Sat, 13 Jun 2026 16:22:44 +0000</lastBuildDate>
    <item>
      <title>(C#) LazyLoader - a simple, thread-safe class that can be used to load data on demand. - stewartrae</title>
      <link>https://snipplr.com/view/57114/lazyloader--a-simple-threadsafe-class-that-can-be-used-to-load-data-on-demand</link>
      <description>&lt;p&gt;A simple, thread-safe wrapper class for lazy-loading data into an instance on-demand (i.e. when the instance is first accessed.)&#13;
&#13;
Usage:&#13;
&#13;
LazyLoader&lt;Foo&gt; l = new LazyLoader&lt;Foo&gt;(() =&gt; Foo.LoadFromDataSource("DB Connection String"));&#13;
&#13;
// For access to the lazy-loaded instance:&#13;
var x = l.Instance.Bar;&#13;
&#13;
// Need to ensure that the data is loaded deterministically? Use this:&#13;
l.EnsureLoad();&lt;/p&gt;</description>
      <pubDate>Mon, 25 Jul 2011 15:28:10 UTC</pubDate>
      <guid>https://snipplr.com/view/57114/lazyloader--a-simple-threadsafe-class-that-can-be-used-to-load-data-on-demand</guid>
    </item>
    <item>
      <title>(C#) TruncateOnWordBoundary - a useful extension method for cutting a string short, but not in the middle of a word. - stewartrae</title>
      <link>https://snipplr.com/view/54319/truncateonwordboundary--a-useful-extension-method-for-cutting-a-string-short-but-not-in-the-middle-of-a-word</link>
      <description>&lt;p&gt;Ever wanted a method that can truncate a string, but only on a word boundary? This method works like Substring() but doesn't snip a string in the middle of a word, i.e. it only truncates the string on a word boundary. Useful for producing a summary from long text, or when limiting the length of an input field.&lt;/p&gt;</description>
      <pubDate>Tue, 24 May 2011 17:02:11 UTC</pubDate>
      <guid>https://snipplr.com/view/54319/truncateonwordboundary--a-useful-extension-method-for-cutting-a-string-short-but-not-in-the-middle-of-a-word</guid>
    </item>
    <item>
      <title>(C#) ExceptionAssert - a useful class for MSTest that works like Assert.Throws in NUnit - stewartrae</title>
      <link>https://snipplr.com/view/54318/exceptionassert--a-useful-class-for-mstest-that-works-like-assertthrows-in-nunit</link>
      <description>&lt;p&gt;Are you using MSTest as a unit testing framework?  Do you miss the Assert.Throws method in NUnit?  Never fear!  You can use this class - ExceptionAssert - like Assert.Throws within MSTest unit tests.&lt;/p&gt;</description>
      <pubDate>Tue, 24 May 2011 16:40:28 UTC</pubDate>
      <guid>https://snipplr.com/view/54318/exceptionassert--a-useful-class-for-mstest-that-works-like-assertthrows-in-nunit</guid>
    </item>
  </channel>
</rss>
