A A
RSS

Tag Archive | "ASP.NET MVC"

Use ModelBinder to Generically Bind Complex Types

Wednesday, September 3, 2008

View Comments

[Update: Simone brought my attention to the fact that ComplexModelBinder which comes with the framework does exactly that.  You can find more info here] ASP.NET MVC Preview 5 introduce the ModelBinder attribute that can be used to decorate a complex type in an Action.  This allows us to have actions that look like this public [...]

Is this Better than Constructor Injection?

Friday, August 29, 2008

View Comments

So after I finished my post on property injection I thought of something, maybe I shouldn’t use constructor injection for my classes.  Maybe, I can just use lazy properties that would call my IoC (Ninject) Kernel to instantiate the object.  So instead of defining a constructor like this: public IAccountService Service { get; set; } [...]

Property Injection in ASP.NET MVC with Ninject

Friday, August 29, 2008

View Comments

I got a design challenge with asp.net mvc.  I want to keep track of the currently logged in user in the session because I don’t want to hit the database every time I need to get the username or id for a query.  And I have all my controllers inherit from a base controller named [...]

Mocking and Dependency Injection in ASP.NET MVC

Wednesday, August 27, 2008

View Comments

Here is the situation, my controller constructors take multiple interfaces as parameters.  I do this in order to use constructor injection which allows me to inject the controllers with mocked objects in my unit tests. For example, my AccountController takes IEmailService, IFormsAuthentication and MembershipProvider (abstract class) as parameters. During my testing, I want to mock [...]

Ninject: Killer IoC

Thursday, August 21, 2008

View Comments

In my previous post, The Best IoC Container, I decided to go with StructureMap as the framework of choice.  I received a comment telling me to check out Ninject and then a day or two after, I saw Corey Gaudin’s post on using Ninject with MVC, so I decided to try it out. It wasn’t [...]

.net AJAX ASP.NET ASP.NET MVC aspnetmvc Blogging Books C# database di Funny Interesting ioc iPhone jquery Lifestyle LINQ Mac mvc mvcbook MVC Book ninject Open Source php Productivity Programming Random ror ruby Silverlight Software SQL Startup tdd Testing tips Tips & Tricks Uncategorized vb.net Video Visual Studio Web Design Web Dev wordpress Yonkly
Advertise Here

What I'm Doing...

Recent Posts

Yonkly Open Source

Sign up for my newsletter




* = required field

powered by MailChimp!

megree Widget

Apparently, I am connected to Obama. Check this out...
My path to Obama

Cyber Identity