public Startup(IHostingEnvironment env) { // Setup configuration sources. var builder = new ConfigurationBuilder() .AddJsonFile("appsettings.json") .AddEnvironmentVariables(); Configuration = builder.Build(); Configuration["Data:DefaultConnection:ConnectionString"] = $@"Data Source={builder.GetBasePath()}/expense.db"; }
private void RegisterPublisher(IServiceCollection services) { var configurationBuilder = new ConfigurationBuilder(); var path = Path.Combine(configurationBuilder.GetBasePath(), "glimpse.json"); if (File.Exists(path)) { var configuration = configurationBuilder.AddJsonFile("glimpse.json").Build(); services.Configure<ResourceOptions>(configuration.GetSection("resources")); services.Replace(new ServiceDescriptor(typeof(IMessagePublisher), typeof(HttpMessagePublisher), ServiceLifetime.Transient)); } // TODO: If I reach this line, than Glimpse has no way to send data from point A to B. Should we blow up? }