private static EnvironmentInformation RegisterEnvironmentInformation(ContainerBuilder builder) { var environmentInformation = new EnvironmentInformation(); builder .RegisterInstance(environmentInformation) .As<IEnvironmentInformation>() .SingleInstance(); return environmentInformation; }
private static void CreateContainerIfNotExists() { if (container != null) { return; } var environmentInformation = new EnvironmentInformation(); if (environmentInformation.IsInDesignTime) { container = DesignTimeContainerHelper.CreateDesignTimeContainer(); } else { var builder = new ContainerBuilder(); builder.RegisterModule(new DefaultWiringModule()); builder.RegisterInstance(environmentInformation).As<IEnvironmentInformation>(); container = builder.Build(); } }