Category: <span>.net</span>

Heavy controller actions? The Message Bus Pattern to the rescue!

I recently derailed (badly) while working on a simple requirement for RageFeed: new user registration.  We decided to use the baked-in ASP.NET membership and profile providers, and I found myself adding a lot of code to facilitate the registration workflow.  This was a problem in and of itself, but I realized I had a bigger…

Read MoreView 10 Comments

Want to be a better developer?

I’ve been trying to put together a link list of things that have helped me improve as a developer over the last couple of years.  This is far from complete, but it’s a start.  I’m not saying this is an absolute "you have to know these things" list or that it will work for everyone…

Read MoreView 47 Comments

Two things missing from C#

While building some ugly code to walk the Lucene.NET Query graph, I found myself needing two bits of functionality from C# that it sadly doesn’t provide.  There are arguments for and against each of these, but they certainly would have saved me some pain today. Switching off of System.Type The Lucene query graph is a…

Read MoreView 9 Comments

Simplified unit testing for ASP.NET MVC JsonResult

There are quite a few examples floating around on the web that describe how to test your JsonResult objects to make sure the data was correctly packaged.  They all follow the same basic pattern: mock out core ASP.NET objects (such as ControllerContext, HttpResponse, and HttpContext), call JsonResult.ExecuteResult, recover what was written to HttpResponse.Output, and deserialize…

Read More

First Impressions of Resharper 4.5

Well, I broke down and installed the new beta of Resharper a few minutes ago.  This was motivated by the fact that I was working with our gigantic DAL, and 4.1 was really slowing me down (like it always does on large files).  Resharper 4.5 didn’t boast improvements for large files, just large solutions, but…

Read More

Service DashBored: easily monitor your application’s health

James Kolpack has posted a new project and article on CodeProject for monitoring the health of various resources.  Thanks to it’s use of dependency injection, the Service DashBored is easily extensible, so if one of the built-in end points isn’t sufficient for your scenario, you can easily write your own.  And yes, he meant to…

Read More

Unit Testing in .NET Part 3 – Asserting That Your Code Rocks

In the previous entries in this series, you’ve learned about the basics of unit testing, and you’ve seen how to create a very basic unit test.  In this post, you will learn how to fully use NUnit’s Assert class to create a full suite of unit tests.  This post builds off the sample described in…

Read MoreView 1 Comment

I declare victory for C# over C!

Alright, that’s not quite fair, but anyone that assumes that C# is going to be slow just because Java is making a big mistake.  One of my classmates made this mistake, and it should have cost him $5, but I chickened out and wouldn’t take the bet.  Anyway: We had a programming assignment to find…

Read MoreView 4 Comments

Calculating aggregates with Microsoft Parallel Extensions for .NET

The Parallel Extension for .NET (aka PFX) is a new API coming to .NET 3.5 (and included out-of-the-box with .NET 4.0) that greatly simplify and enhance the parallel-processing story in .NET.  Sure, we’ve got Thread and ThreadPool, but these classes are very lacking.  Fortunately, PFX is a huge improvement.  Be sure to check out their…

Read More

Friday Grab-Bag

A severe lack of sleep and the "too many irons in the fire" syndrome has left me a tad frazzled, so instead of a well-written (I see you laughing!) post, you get a collection of random thoughts and observations: Too much lambda? I wonder if I’m relying too heavily on lambda expressions.  What do you…

Read More