Last active
August 29, 2015 14:05
-
-
Save ChuckBryan/47959f1bc2d1531318f4 to your computer and use it in GitHub Desktop.
MVC Registry for Fail Tracker
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public MvcRegistry(Func<IContainer> containerFactory) | |
{ | |
For<BundleCollection>().Use(BundleTable.Bundles); | |
For<RouteCollection>().Use(RouteTable.Routes); | |
For<IIdentity>().Use(() => HttpContext.Current.User.Identity); | |
For<HttpSessionStateBase>() | |
.Use(() => new HttpSessionStateWrapper(HttpContext.Current.Session)); | |
For<HttpContextBase>() | |
.Use(() => new HttpContextWrapper(HttpContext.Current)); | |
For<HttpServerUtilityBase>() | |
.Use(() => new HttpServerUtilityWrapper(HttpContext.Current.Server)); | |
For<IUserStore<ApplicationUser>>() | |
.Use<UserStore<ApplicationUser>>(); | |
/*This is a factory to get the DBContext for the Identity*/ | |
For<DbContext>().Use(() => new ApplicationDbContext()); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment