Lazy<T> with implicit cast to T can give you some pretty code

Magnus Mårtensson

Adding an implicit cast functionality to Lazy<T> can give you an option to writing null checkers in your delayed instantiation properties. The problem Today in our project a colleague was cussing over the fact that he kept writing the same block of code over and over again when null checking a property with a backing [...]

Tags: ,

Handling Lazy + Metadata instances in Managed Extensibility Framework (MEF)

Magnus Mårtensson

Have you ever wanted to dynamically choose from many potential implementations of some code? Would you like to have the power of metadata filtering and lazy instantiation of the selected implementation? Here is how to do just that using Managed Extensibility Framework (MEF) and also a neat trick to handle your implementation/metadata pairs that I [...]

Tags: , ,

Seamless Web Development

Anders Janmyr

Do you remember the time before 9/11 when you could arrive to the airport 10 minutes before the plane’s departure and just walk on to the plane. Now, you have to arrive at least an hour before the plane departs and you have to strip to get through a security. The security is just for [...]

Tags: , ,

Readable and testable asynchronous execution

Andreas Hallberg

Executing code asynchronously in C# gives you at least two headaches: the code becomes hard to read and a pain to unit test. Here’s one way to alleviate these pains, using a configurable singleton aptly named “Async”: Async.Execute(() => { // … Console.WriteLine(“We’re running this on a background thread”); // … etc }); That’s the [...]

Tags: , , ,

Neo4j .NET Client over HTTP using REST and json

Magnus Mårtensson

Here it is; a Proof of Concept of the world’s first Neo4j .NET Client. In other words: Here follows a discussion on how to create a client library for communicating with a graph database over REST. UPDATE: There is now a live CodePlex project for the realization of this concept; A .NET Client Library for [...]

Tags: , , , ,