private void ConfigureSyndicationFeedReader(IServiceCollection services) { services.TryAddSingleton <ISyndicationFeedReaderSettings>(s => { var settings = new SyndicationFeedReaderSettings(); var configuration = s.GetService <IConfiguration>(); configuration.Bind("Settings:SyndicationFeedReader", settings); return(settings); }); services.TryAddSingleton <ISyndicationFeedReader, SyndicationFeedReader>(); }
private void ConfigureSyndicationFeedReader(IFunctionsHostBuilder builder) { builder.Services.TryAddSingleton <ISyndicationFeedReaderSettings>(s => { var settings = new SyndicationFeedReaderSettings(); var configuration = s.GetService <IConfiguration>(); configuration.Bind("Settings:SyndicationFeedReader", settings); return(settings); }); builder.Services.TryAddSingleton <ISyndicationFeedReader, SyndicationFeedReader.SyndicationFeedReader>(); }