On a quest for the silver bullet..

» Currently browsing: C#


How I use the Glue mapping framework

Number of Comments » 3

Glue is a general purpose, bidirectional automatic mapping framework for the .Net platform, with strong verification and testing tools.
I’m actively developing it. I’m also actively using it. In this post I’ll share my experience as a user of Glue, and how easy it is to set up the mappings using TDD.
The example
We want to create [...]

Glue – the new mapping framework

Number of Comments » 6

I’ve spent this summer implementing a new mapping framework for the .Net plattform: Glue.
You’ll find examples and code here: http://glue.codeplex.com
Glue is a general purpose, bidirectional automatic mapping for the .Net platform, with strong verification and testing tools.
I’ve seen quite a lot of less than optimal handling of mapping issues in quite a few projects over [...]

ASP.NET MVC: DefaultControllerFactory is not thread safe!

Number of Comments » 0

I am not sure if this is a bug or a “feature” of the ASP.NET MVC framework. Either way, this is something you should be aware of as it can cause some very hard to track concurrency issues which might leak information between your HttpRequests.
In my last project we used the ASP.NET MVC framework along [...]

ASP.NET MVC: Let StructureMap create your controllers

Number of Comments » 3

For those of you already familiar with StructureMap and want to use it to configure your objects in ASP.NET MVC, read on.
The ASP.NET MVC framework has a default controller factory (DefaultControllerFactory) that requires all controllers to have a parameterless constructor. So, if you want to inject your dependencies to the constructor, you can’t do it. [...]

Creating a dynamic xml reader with C# 4.0

Number of Comments » 2

“The static type dynamic” was the catchphrase at PDC’08 when talking about what’s new in C# 4.0. The dynamic type seems to be introduced mainly to simplify the code you write when doing Com interop. But many also see this as a step towards the dynamic languages for C#. I like C#. I also like [...]

Looping collections in C#

Number of Comments » 3

In this post I want to demonstrate that with a few nice language features in C# we can do more with less when working with collections, meaning expressing more with less code.
There are a couple of points I want to make here. First I care about writing code that can be easily understood after it [...]