Posts tagged dependency injection

There are 3 posts for the tag dependency injection

Dependency injection in ASP.NET MVC 3 got a lot simpler

In my project of writing my own blog engine, I’m using ASP.NET MVC 3 beta, and I like what they have done to simplify the dependency injection! Let me show you the difference. The MVC 2 way First, I need a registry (that’s just ScructureMap, nothing really to do with MVC). //The most simple registry I could think of public class AlphaRegistry : Registry { public AlphaRegistry() { Scan( x => { x.AssembliesFromApplicationBaseDirectory(); x.With...

Posted by johan on October 30, 2010

Unit testing saving pages in EPiServer CMS 6

I’ve been working quite a lot with EPiServer in the last six years or so, and unit testing has always been a pain in the ass (not that I was writing unit tests anyway six years ago, I hardly knew what I was doing back then… can’t believe I actually got paid! :-)). And it still is, even in the latest version. Luckily there are some EPiServer developers that are either smarter than me, or just have more free time, for example Joel Abrahamson who has created a wrapper project, EPiAbstractions, fo...

Posted by johan on August 11, 2010

Do NOT forget to close() your WCF ServiceClients!

We had a very disturbing problem today. Our client was doing acceptance testing on the application we’re building for them, and had assembled a team of 15 people to do it. The application ran smoothly, until after a few minutes it came to a grinding halt and simply stopped responding. We checked the server, and the CPU was fine. For a while, after a minute or so it went up to 100%. The application is an ASP.NET MVC web client, talking to WCF services, which are talking to an SQL Server. Everyth...

Posted by johan on March 16, 2010