May 2010 Entries

The Grand Unified Framework Theory

Tom Janssens left a comment: What still bugs me is that we do not have a unified pattern for all .net dev (using modelbinders and icommand for example...) But, Tom – we are pretty close. At least as close as we should be, I think. With .NET there are plenty of low level patterns we can reuse regardless of the application platform or architecture. Stuff like: Asynchronous programming with events or the TPL. Object queries with LINQ. Resource management with IDispose. ...

What’s Wrong With This Code (#25)

The goal: create an extension method that will make it easy to create FormCollection objects. The method is a helper for unit testing ASP.NET MVC code. public static FormCollection ToFormCollection(this object data) { var namesAndValues = data.GetType() .GetProperties() .WhereValueIsNotDefaultValue(data) .ToNameValueCollection(data); return new FormCollection(namesAndValues); } The extension method itself relies on a...

Scott Allen
Posts - 869
Comments - 4493
Stories - 14