Tag Archives: db connection

(C#) LazyLoader – a simple, thread-safe class that can be used to load data on demand

A simple, thread-safe wrapper class for lazy-loading data into an instance on-demand donde puedo comprar metformina. (i.e. when the instance is first accessed.) Usage: LazyLoader l = new LazyLoader(() => Foo.LoadFromDataSource("DB Connection String")); // For access to the lazy-loaded instance: var x = l.Instance.Bar; // Need to ensure that the data is loaded deterministically? Use [...]

Posted in C# | Also tagged , , , , , , , , | Leave a comment