public void InitIoc() { Dictionary <Type, Type> bindings = new Dictionary <Type, Type>(); bindings.Add(typeof(DbContext), typeof(ApplicationUsersDbContext)); bindings.Add(typeof(IUserStore <ApplicationUser>), typeof(UserStore <ApplicationUser>)); IoCContainer.Initalize(bindings); StructureMapDependencyScope = new StructureMapDependencyScope(IoCContainer.GetContainer()); DependencyResolver.SetResolver(StructureMapDependencyScope); DynamicModuleUtility.RegisterModule(typeof(StructureMapScopeModule)); }