posts - 81, comments - 262, trackbacks - 0

MVC Preview 4 Account Controller and StructureMap Registry


I decided to use the MVC Preview 4 Account Controller with my MVC application. The application has been following the StoreFront sample application which is using StructureMaps. The trick in getting the two to work together is the following in configure()

 

ForRequestedType<IFormsAuthentication>()

.TheDefaultIsConcreteType<FormsAuthenticationWrapper>();

 

ForRequestedType<MembershipProvider>()

.TheDefaultIs(Membership.Provider);

 

In this way the web.config values are used for the provider. Without passing Membership.Provider (say by passing a new SQL provider) the configurations will be defaulted.


Print | posted on Saturday, August 23, 2008 6:04 PM | Filed Under [ Web Programming ]

Powered by:
Powered By Subtext Powered By ASP.NET