The dynamic programmer
.Net framework and languages

Microsoft MVC coming along.

Yesterday Scott Gu post again about the MVC framework. Don't miss his post about Passing View data from controllers to view.

A REST API in 20 minutes - Part 2.

In this second part we look at the factory methods to handle the different request and the formatters classes.

A REST API in 20 minutes - Part 1.

If you haven't look at it, take a look at the Subsonic project, is really cool and can generate a ORM infrastructure faster than any other framework I tried out there. It also provides a cool HTTPHandler to expose those objects.

MVC framework in .NET by Microsoft

In the altnet conference the guys from Microsoft presented an MVC framework that will be released on the spring. It promise to be something really good, it's seems to be so flexible that you can plug into it whatever framework you are used to.


I'm trilled to discover that I'm not crazy and that my search and adoption of alternative tools (alternatives to the Microsoft tools) to develop in .net is a philosophy adopted not only by me but for a lot of people. It even has a name ALT.NET.

DynProg.Validation now available on NuGet

My own validation library for .Net that introduce a simple DSL to make validation of arguments and method calls easier and less annoying.

Being productive with MVC 3.

On how using MVC 3, NuGet, MvcScaffold, EF code first, Git and AppHarbor make me have fun again using the Microsoft stack.

Luca, a quick look at the request object.

I decided to completely isolate Luca from the HttpRequest object and define my own. The main advantage of this approach is that having a pure javascript object, mocking and stubbing is extremely easy, making testing a breeze.

Luca, writing a simple web service.

As a first simple example of using Luca I wanted to write a simple web service that returns json or plain text.

Luca, abstracting the request object.

The JavaScript engine allows for the use of .Net objects inside JavaScript, but I wanted to completelly abstract Luca from anything related to the HttpContext.

Luca - server side JavaScript websites in .Net, choosing the engine.

I wanted a very simple framework more like Sinatra than Rails. Something that make very easy to put together some simple Restful websites. And I wanted to use JavaScript to write my code and be able to run it inside .Net and IIS. But first I needed to find my JavaScript engine.

Playing with NSubstitute, a new mocking framework for .Net

I heard about NSubstitute on episode 26 of Talking Shop down under. It sounded like an interesting framework with some interesting ideas, so I took it for a spin.

Creating a MongoDB provider for Blogengine.Net - Part 1

The code in this post is of demo quality and should not be taken as production ready code. It's a first take on the project and will evolve during a series of posts. is an open source blogging platform written in

Insert route, route registration after the fact on ASP.NET MVC

Kazi Manzur Rashid has a post about registering Areas dynamically after the registration of other routes and the problems this has since the order the routes are registered is very important.

Using MongoDB from C#

The NoSql movement is gaining more and more momentum. A year or two ago I took a look at CouchDb but this time I wanted to try MongoDB.

Using the Connection String section for Log4Net and NHibernate

The other day at the office my boss took a look at our configuration files and he expressed his concern about breaking DRY with all the ConnectionStrings. One for Ado.Net, one for NHibernate, one for our caching db and another for Log4Net.

Proper naming in generics and Lambda expressions.

Hopefully gone are the days were you considered ok the use of single letter names for your variables or your arguments and you are giving informative names to all the artifacts in your code.

Yellow sticky notes for your watched variables in the new VS 2010.

One new feature in the code editor is the ability to put sticky notes in the code while debugging. This sticky notes are actually attached to a given variable and you can see the actual value of it in the note (similar to using the watch window).

A simple solution to the Big Fat Controller problem in MVC.

This post have been inspired by the talks about controllerless actions. This is NOT an alternative to that. Controllerless actions is an interesting concept that should be study. Actually Jeffrey Palermo has a concept implementation.

FirstOrNullObject extension method for IEnumerable<T> and FirstOrNew.

In the context of this article every time I mention Linq I'm actually talking about Linq To Objects. Although Linq has a very handy method on FirstOrDefault<T>.

Tuple, a new type on .Net 4.0

If you ever played with some language that have the Tuple type I bet you miss it in .Net. Well 4.0 adds it. Let's see what the ubiquitous Wikipedia have to say about it.

More from Oredev 08 - Ayende on ActiveRecord to write less code.

A very good presentation with lots of code to learn and appreciate some of the niceties of ActiveRecord.

Extending ASP.NET MVC

I want to be positive in this post. So I will just mention this once. The framework is very extensible but It's more difficult that It should. I guess that the problem is not really with the framework, but me trying to make it do something that is not in the spirit of it.

The Herding Code - NHibernate performance podcast

Today I have the pleasure to listen to a really good episode of The Herding Code. The episode title was NHibernate performance. In the episode Ayende, David Penton and Ben Scheirman talked about NHibernate and the performance of the tool ...

How Linq works, lamdbas, anonymous delegates and some compiler voodoo.

If you have been following this blog, you probably saw a few posts about what's going on behind closed doors once you submit your code to the mercy of the compiler.

ASP.NET MVC in Action chapters 5,6 and 7.

I enjoyed this chapters as well, specially chapter 6 and 7 about extending the framework and preparing your site so it scale. Some of the code examples are using a previous (old) version of the framework. I hope they will be updated for the print version.

Gurtle, access your Google code issue tracker from inside TortoiseSVN

In my previous post I mentioned how to integrate Visual Studio with Subversion for free and without having to install fancy plug-ins.

Integrate Visual Studio with TortoiseSVN for free.

Now there is another choice and is a set of configuration options to access TortoiseSVN from inside Visual Studio. The set of configurations provide a tools menus, context menu, and menu bar.

The problem with third party libraries; Exceptions..

In this post I wrote about wrapping log4net (as an example) in your own logging class and define an interface for the log object that better reflects your domain.

Elegant Code Cast and a bit about testing and the role of QA.

On episode 20 of the Elegant Code Cast Matt Heusser talks about testing in general and the role of QA in an agile team.

Check.That validation framework reworked

I just finished a complete re write of my validation framework. This re write was due to feedback received from some of my co workers so I owe to them my thanks.

XGENO.ORG new lightweight ORM Mapper.

You can find this new ORM framework at http-// Starting with it is fairly easy. Just add a reference on your project to the very small (32K) dll (only one!) and you can start playing with it.

FubuMVC now runs on Cassini!!!

A few moments ago (55 minutes to be exact) Chad Myers made a commit on revision 55 of the FubuMVC enabling this to run using F5 inside Visual Studio, using Cassini.

The Herding code podcast about FubuMVC.

Herding code interview with Chad Myers and Jeremy Miller on FubuMVC

New Release of CC.Net Community plugIns on CodePlex.

If you use Cruise Control.Net you may want to take a look at this project. CC.Net Community PlugIns

FubuMVC another MVC framework for .Net

We are living in very exiting times in the .Net world. Every time I look I find a new framework to do web development. I recently found FubuMVC. This framework is a bit different from Sharp Architecture or the Catharsis guidance

Catharsis, a complete framework for developing Web apps using MVC and NHibernate 2.0

Once in a while I like to browse around Codeplex to see what's new and if I found anything interesting. Today I found this Gem of a project called Catharsis. To be able to use it you will need VS 2008 with SP1.

Implementing a validation class.

Every time I wrote validation this code I think, I should write a library to do this for me. So I went ahead and wrote this simple class. The idea is to use the Introduce Assertion Refactoring in this cases and write this code in this way. ...

Microsoft Code Analysis Tool (CAT) identify vulnerabilities on your code.

CAT is a Visual Studio Add-in that analyze your code and all the references in your project looking for vulnerabilities to common attacks.

Sharp Architecture project template in a machine without ASP.NET MVC Beta installed

In my machine at work I can't install ASP.NET MVC (it installs but fails to install the project templates, I don't know why and I haven't had time to look into it).

ASP.NET MVC RC 1 coming next January.

At least two really good post today about the future RC1 for the ASP.NET MVC framework.

Sharp Architecture approaching version 1.0.

Pronounced Sharp Architecture, this is a solid architectural foundation for rapidly building maintainable web applications leveraging the ASP.NET MVC framework with NHibernate.

Scout plug in for Resharper to navigate your code.

This is a plug-in for Resharper that allows you to use Reflector and and the .Net framework source code to navigate your code. You can download it from the Google code project page.

Uskhay a web framework and a programming exercise.

I will try to create a simple CMS framework on top of the ASP.Net MVC. This will be mostly an exercise, something that I feel I need to try to see how it works.

Do you need to format the code for your blog?

C# format is an online tool to format your C#, VB, HTML, XML, T-SQL or MSH code into valid HTML 4.01 complaint code to put online.

Release of new versions of very cool software - NHibernate and Json.NET.

In the last few days two of my favorite pieces of software released new versions.

The Onion Architecture and a layered aproach.

A few weeks ago Jeffrey Palermo published his notion of an Onion Architecture. The first time I saw it was during his MVC presentation at DevTeach Toronto and I really like it.

PartCover.Net and CC.Net Part 2 - Making it pretty.

In my previous post I show how to integrate PartCover reports into CC.Net and promise to look into make the reports look a bit nicer and try to integrate the Coverage metrics into the statistics reports. So I dust off my xslt ...

Integrate PartCover.Net and Cruise Control.Net

A few months ago I mentioned that I was using PartCover.Net to measure test coverage in my projects. I have been really busy but I decided that this week I was going to integrate the reports with CC.Net. Cruise Control ships with NCover support o...

Nant build scripts template for Visual Studio

I was creating for the 10th time today a nant build file from Visual Studio when I came to the realization that I needed to automate the process a bit more. So I created an item template to include build files. You just need to copy this zip file...

Linqy batch of goodness - TVBUG meeting with Scott Hanselmann.

Notes on Beth Massi and Scott Hanselmann presentations at the TVBUG.

Testing your pages with NunitAsp (and no web controls)

Testing is fundamental to get your code into shape and to be sure that what you are doing is behaving as expected. New methodologies like Test Driven Design (TDD) point to that goal.

The SmartBag to replace the ViewData on MVC

Jeffrey Palermo posted about replacing the ViewData on the MVC framework with a generic container called SmartBag. The advantage is that the container will return an object of a given type, so no more casting and also no more using string keys...

CSS parser class in .NET.

We are changing our template system at work and my boss ask me to look around for a css parser class. The class needed to load a bunch of css files and parse them to be able to get a value from an attribute of a given key.

PartCover the Code Coverage tool for me

A free tool to do code coverage with a nice GUI for the developers to use, that can be run on the command prompt, that generates nice xml based reports (to integrate with your CC server) and best of all for me) that works fine with Static methods...

Extending the string object in c#

I have found some controversy in some post in the wild where I demonstrate how to extend the string object. Sometimes the controversy is around the examples presented. So I decided to make my own example with methods that I wish were included in the framework.

NAnt 0.86 beta 1 with support for 3.5 is available

I went today to the Nant site to check some documentation and I saw that the beta 1 of the new version is available, this version supports the .NET 3.5 framework, Mono 3.5, Silverlight 2.0 and Moonlight 2.0

The same template in the client and server side.

Prototype is one of the most popular javascript libraries out there and one of the features I really like is the template implementation. When you create an Ajax application there are multiple opportunities to use templates in the client side.

The future of C#.

They talk about LINQ and the changes needed to support it in c#. There is a very interesting point on Extension methods a feature that fascinate myself and scare me a little bit. It's so cool that I know that we will overuse it at the beginning.

LINQ to search arrays and Auto-implemented properties.

This is a cool example of using LINQ to query and filter an array. I like this use of LINQ.

Using Microsoft ASP.NET MVC with DooDads

I have been using DooDads, a free, open source ORM architecture for a while now. I like that I can easily use it with any database structure, not matter how bad it is.

Microsoft MVC framework available

The CTP release of the Microsoft MVC framework is available with the ASP.NET 3.5 extensions.