public Task ProcessDeploymentStepAsync(DeploymentStep step, DeploymentPlanResult result) { var settingsStep = step as SettingsDeploymentStep; if (settingsStep == null || (!settingsStep.IncludeAzureHubSettings && !settingsStep.IncludeSignalHubSettings)) { return(Task.CompletedTask); } if (settingsStep.IncludeAzureHubSettings) { var options = new AzureHubSettings(); _azureHubOptions.Configure(options); var data = new JArray(); result.Steps.Add(new JObject( new JProperty("name", nameof(AzureHubSettings)), new JProperty("settings", JObject.FromObject(options)) )); } if (settingsStep.IncludeSignalHubSettings) { var options = new SignalHubSettings(); _signalHubOptions.Configure(options); var data = new JArray(); result.Steps.Add(new JObject( new JProperty("name", nameof(SignalHubSettings)), new JProperty("settings", JObject.FromObject(options)) )); } return(Task.CompletedTask); }
public JobWatchdog(IConfigureOptions <FolderWatchdogConfiguration> configuration, JobAdapter jobAdapter) { _jobAdapter = jobAdapter; _config = new FolderWatchdogConfiguration(); configuration.Configure(_config); _swatcher = new Swatcher(_config); }
public SetupController(IConfigureOptions<AppSettings> appSettings, ApplicationContext context, IUnitOfWork unitOfWork) { _settings = new AppSettings(); appSettings.Configure(_settings); _appContext = context; _unitOfWork = unitOfWork; }
protected static IConfigurationHolder GetConfigurationHolder(ServiceProvider provider) { IConfigureOptions <ServiceModelOptions> options = provider.GetRequiredService <IConfigureOptions <ServiceModelOptions> >(); options.Configure(new ServiceModelOptions()); IConfigurationHolder settingHolder = provider.GetService <IConfigurationHolder>(); return(settingHolder); }
private SentryOptions GetOptions( IConfigureOptions <SentryOptions> optionSetup) { var options = new SentryOptions(); optionSetup.Configure(options); return(options); }
public U2FManagerService(ApplicationDbContext userRepository, UserManager <ApplicationUser> userManager, SignInManager <ApplicationUser> signInManager, IConfigureOptions <U2FManagerOptions> options) { dataContext = userRepository; this.userManager = userManager; this.signInManager = signInManager; options.Configure(this.options); }
public static UrlToolsOptions GetOptions(IOptions<UrlToolsOptions> options, IConfigureOptions<UrlToolsOptions> configure) { var opts = options != null ? options.Value ?? UrlToolsOptions.Default : UrlToolsOptions.Default; if (configure != null) { configure.Configure(opts); } return opts; }
public void AddsJsonMergePatchInputReader_ToMvcOptions() { var sut = new ModelBuilderExtensionGenerator(); var code = sut.CreateModelBuilder("new LaDeak.JsonMergePatch.SourceGenerator.AspNetCore.Tests.TypeRepositoryHook()"); var mvcBuilder = Substitute.For <IMvcBuilder>(); var services = Substitute.For <IServiceCollection>(); mvcBuilder.Services.Returns(services); IConfigureOptions <Microsoft.AspNetCore.Mvc.MvcOptions> optionsSetup = null; services.When(y => y.Add(Arg.Is <ServiceDescriptor>(x => x.ServiceType == typeof(IConfigureOptions <Microsoft.AspNetCore.Mvc.MvcOptions>)))) .Do(callInfo => optionsSetup = (callInfo[0] as ServiceDescriptor).ImplementationInstance as IConfigureOptions <Microsoft.AspNetCore.Mvc.MvcOptions>); var options = new Microsoft.AspNetCore.Mvc.MvcOptions(); GetMethodDelegate(code)(mvcBuilder, null, null); optionsSetup.Configure(options); Assert.Contains(options.InputFormatters, x => x is JsonMergePatchInputReader); }
public AssetResponseStore(ILogger <AssetResponseStore> logger, IWebHostEnvironment env, IConfigureOptions <WebOptimizerOptions> options) { _logger = logger; _env = env; options.Configure(_options); }
public SampleApi(IConfigureOptions<AppSettings> configuration) { _settings = new AppSettings(); configuration.Configure(_settings); }
public DomainAssemblyResolver(IConfigureOptions <DomainAssemblyResolverConfiguration> configuration) { _configuration = new DomainAssemblyResolverConfiguration(); configuration.Configure(_configuration); _semaphoreSlimForJobs = new SemaphoreSlim(1, 1); }
public ActiveDirectoryManagerService(ILogger <ActiveDirectoryManagerService> logger, IConfigureOptions <ActiveDirectoryIdentityOptions> options) { this.logger = logger; options.Configure(this.options); principalContext = new Lazy <PrincipalContext>(InitContext, true); }
public void Configure(StringGetterGetterWithLoggingOptions options) { _configureBaseOptions?.Configure(options); options.Logger = _logger; }