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 [...]
Lazy<T> with implicit cast to T can give you some pretty code
August 9th, 2010 by Magnus Mårtensson — .Net, Tips & Tricks
Handling Lazy + Metadata instances in Managed Extensibility Framework (MEF)
August 4th, 2010 by Magnus Mårtensson — .Net, Architecture, Tips & Tricks
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: .Net, .NET Framework, tips
Seamless Web Development
June 8th, 2010 by Anders Janmyr — .Net
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 [...]
Readable and testable asynchronous execution
May 27th, 2010 by Andreas Hallberg — .Net, Tips & Tricks
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: .Net, async, asynchronous, C#
Neo4j .NET Client over HTTP using REST and json
April 16th, 2010 by Magnus Mårtensson — .Net, Architecture, Cloud
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: .Net, httpclient, json, neo4j, rest
