Monthly Archives: September 2011
A more structured MembershipProvider.
If you take a look at the official documentation that tells you how to create your own custom MembershipProvider you’ll notice that the documentation is mostly about describing: how you should throw exceptions and when Which events you should invoke … Continue reading
Why extension methods should not be used as part of a framework.
Two of my favorite frameworks/libraries uses extension methods heavily. Autofac uses extension methods during registration and ASP.NET MVC3 for their HTML Helpers. Since extension methods are static, they are closed for extension. Which are one of the most important principles … Continue reading
Easy model and validation localization in ASP.NET MVC3
Update I’ve written a more complete article about the framework at codeproject.com. If you have googled a bit you’ll read that you should use DescriptionAttribute and DisplayNameAttribute to get localization which will result in a view model that looks something … Continue reading
Getting information into the Layout without using ViewBag.
You should avoid using the ViewBag as much as possible since you get run-time errors instead of compile time error if something fails. The problem is that it can be hard to avoid it if you are using information in … Continue reading
Begin/End asynchronous methods vs the new Async methods
A new asynchronous model was introduced in .NET 3.5sp1 where all methods ends with ‘Async’ like Socket.RecieveAsync. I will not give you any code samples, there are several articles out there which shows how the new model work. Instead I’m … Continue reading
An easier way to debug windows services
Have you got tired of attaching the Visual Studio debugger to the service application? I got the solution just for you! It’s a small helper class containing a static method which you need to invoke. Then go to project properties, … Continue reading
Inversion of control containers – Best practices
Disclaimer: I’ve used IoC containers for a couple of years now and also made a couple of my own (just to learn, nothing released). I’ve also consumed loadsĀ of documentation in the form of blogs and stackoverflow questions. And I thought … Continue reading