Browse by Tags

All Tags » .NET (RSS)

Using Windsor to inject dependencies into ASP.NET MVC ActionFilters

I'm using Windsor as my IoC container for an ASP.NET MVC application .  To get dependency injection in my controllers, I'm using a slightly modified WindsorControllerFactory from Andre Loker's post earlier this year .  It works great and allows...
Posted by PSteele | 3 comment(s)
Filed under: ,

Extension Properties

A couple of weeks ago, a post I made about Strongly Typed Session Variables in ASP.NET led to some interesting comments and discussion.  One of the comments asked "Why can't we just have extension properties…?".  Now, Eric Lippert...
Posted by PSteele | 1 comment(s)
Filed under:

This isn't an error?

I just saw something odd in a diff before a check-in.  Basically, I had a trailing comma in an object initializer: namespace ConsoleApplication1 { class Program { static void Main( string [] args) { var foo = new Foo { A = "A" , B = "B"...
Posted by PSteele | 7 comment(s)
Filed under:

Unit Tests and Debug.Assert()

I recently found some code that had a couple of issues: There was a try/catch block that did a "catch(Exception e)".  And no, it didn't rethrow the exception.  See item #2. Inside the exception handler, it had the following code: catch...
Posted by PSteele | 4 comment(s)
Filed under: ,

LINQ and Homework

My daughter asked me to check her homework today.  One of the math problems was: A book has 352 pages.  How many 4's were used to print all of the page numbers. She got 35.  She explained how she arrived at that number and while her logic...
Posted by PSteele | 14 comment(s)
Filed under: ,

Strongly Typed Session Variables in ASP.NET MVC

This post was originally going to be a comment on Jarret@Work's blog post about " Using Extension Methods for Session Values ", but I decided to make a full blog post out of it.  Jarret employed extension methods such Bar()/SetBar() and...
Posted by PSteele | 18 comment(s)
Filed under: ,

Handy Extension Methods for ASP.NET MVC's UrlHelper

Mickael Chambaud posted three extension methods he created for UrlHelper: Image(), Stylesheet() and Script().  They make it pretty easy to keep your images, stylesheets and scripts organized in a single location – without the need for you to remember...
Posted by PSteele | 1 comment(s)
Filed under: ,

Enabling Windsor Integration in MonoRail

I recently wanted to take on old MonoRail application and update it to use Windsor for dependency injection (DI).  The application stated as a sort of prototype and slowing grew into a decent sized application.  There's a couple of places that...
Posted by PSteele | 1 comment(s)
Filed under: , ,

ASP.NET MVC + MVC Contrib + Unit Testing

One of the key benefits of the MVC (Model View Controller) pattern is a separation of concerns that leads to better testability.  Microsoft recognizes this and will automatically create a separate MS Test project when creating a new ASP.NET MVC solution...
Posted by PSteele | 5 comment(s)

Know Your Environment!

This is probably one of the most embarrassing things I've admitted to in public (well, maybe not – but close).  I really had to think about whether I wanted to post this.  The mentor in me said "You need to post this.  Others may run...
Posted by PSteele | 3 comment(s)
Filed under: ,
More Posts Next page »