The introduction of the dynamic keyword in C# 4.0 allows you to do a lot of things you couldn’t do otherwise, but it also makes it easy to forget that C# is still not a dynamic language, so there are limitations. Recently I found myself wanting to whip up a quick test page for something, with a very simple controller action and view. It wasn’t meant to be permanent, so creating a dedicated…
Attribute-Based Property Aliases Using MongoDB and NoRM
Since MongoDB is a document database, collections don’t have an enforced schema. Each document in a collection needs to store the names of all of its properties, making the length of that name more significant. Using abbreviated property names helps cut down on the storage space needed for each document, but it’s not ideal to mirror those abbreviated names in your object model. To help solve this problem, the NoRM driver provides an easy…
Introducing WindowHerder: Take Control of Your Windows
Recently I’ve been working on a small utility to help scratch a particular itch I had with managing the placement of windows on my screens. More specifically, I found that I would arrange everything how I wanted it in order to be the most productive, and would then have to keep redoing that every time I switched out of that context to check on something else. Enter WindowHerder – my solution to the problem. What Does…
ASP.NET MVC: Do You Know Where Your TempData Is?
I recently discovered that despite the fact that I’d been using the TempData dictionary in my applications, I didn’t really have a full grasp on what it was doing behind the scenes. Of course this meant learning the lesson the hard way once something stopped working like I thought it would. I only really had myself to blame since in the end it was a simple case of RTFM, but it seemed like a…
Dynamic Views in ASP.NET MVC 2
One of the new features introduced in C# 4.0 is the dynamic keyword. So far I haven’t had much use for it, but lately I’ve discovered that it can be very useful when designing ASP.NET MVC views. It also has uses when interacting with COM APIs and other dynamic languages, but I’m going to focus on its use in MVC. If you’re using .NET 4.0 and ASP.NET MVC…