protected void Application_Start(object sender, EventArgs e) { var container = StructureMapRegistry.Initialize(); GlobalConfiguration.Configuration.DependencyResolver = new StructureMapResolver(container); GlobalConfiguration.Configure(WebApiConfig.Register); RouteConfig.RegisterRoutes(RouteTable.Routes); }
private void SetupStructureMap() { var registry = new StructureMapRegistry(); var container = new Container(registry); var structureMapServiceLocator = new StructureMapServiceLocator(container); ServiceLocator.SetLocatorProvider(() => structureMapServiceLocator); var locator = new StructureMapServiceLocatorControllerFactory(); ControllerBuilder.Current.SetControllerFactory(locator); }
public static void SetUp(StructureMapRegistry reg) { //IPGPKeys keys, IPGPIO files, string our_public_key_path, // string our_private_key_path, string passphrase reg.For<IPGPWrapper>().Use<PGPWrapper>().Ctor<string>("our_public_key_path").Is(CJR_PUBLIC_KEY).Ctor<string>( "our_private_key_path").Is(CJR_PRIVATE_KEY).Ctor<string>("passphrase").Is(PASSPHRASE); reg.For<IFileUtilities>().Use<FileUtilities>(); reg.For<IFTPConnection>().Use<FTPConnection>(); reg.For<IFTPRepository>().Use<FTPRepository>(); reg.For<IPGPKeys>().Use<PGPKeys>(); reg.For<IPGPIO>().Use<PGPIO>(); reg.For<IPGPReader>().Use<PGPReader>(); reg.For<IPGPWriter>().Use<PGPWriter>(); reg.For<IPGPKeyring>().Use<PGPKeyring>(); reg.For<IFTPFileService>().Use<FTPFileService>(); reg.For<IFTPNavigator>().Use<FTPNavigator>(); reg.For<IFTPLocalFileRepository>().Use<FTPLocalFileRepository>(); reg.For<IFtpWorker>().Use<FtpWorker>(); }