// IPreferencesAdapterFactory preferencesAdapterFactory = (IPreferencesAdapterFactory)DependencyResolver.Current.GetService(typeof(IPreferencesAdapterFactory)); ILoginImageDisplayDatesFactory factory = (ILoginImageDisplayDatesFactory)DependencyResolver.Current.GetService(typeof(ILoginImageDisplayDatesFactory)); if (factory != null) { ILoginImageDisplayDatesAdapter adapter = factory.GetService(); DateTime? dt = DateTime.Now.AddDays(-1); adapter.UpdateImageDates(dt); } }The commented code works fine, but my code returns null for the factory. Do you see what may be wrong or what I may be missing?
> protected void Application_Start() > { > ViewEngineConfig.Configure(); > > NinjectConfig.Configure(GlobalConfiguration.Configuration); > GlobalConfiguration.Configure(x => x.MapHttpAttributeRoutes()); > WebApiConfig.Register(GlobalConfiguration.Configuration); > FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters); > RouteConfig.RegisterRoutes(RouteTable.Routes); > BundleConfig.RegisterBundles(BundleTable.Bundles); > > AutoMapperConfig.Configure(); // MUST come after call to NinjectConfig.Configure(). > ModelBindersConfig.Configure(); // MUST come after call to NinjectConfig.Configure(). > PreferencesLoad.Load(); // MUST come after call to NinjectConfig.Configure(). > StartupTasks.Perform(); > MainMenuConfig.RegisterMainMenu(); > > }>