protected async Task <(bool result, dynamic contentValue)> HandleMessageContentAsync(HttpContent httpContent) { (bool result, dynamic contentValue) = await HttpContentReader.ReadAsync(httpContent); if (!result) { Logger.ContentNotSupported(httpContent.GetType().FullName); return(false, default);
private void ConfigureBusinessLayer(IServiceCollection services) { var contentConfig = Configuration.GetSection("Content").Get <ContentConfig>(); var httpContentReader = new HttpContentReader(contentConfig.Url); var sampleDataReader = new SampleDataReader(contentConfig.Albums, contentConfig.Photos, httpContentReader); services.AddSingleton(typeof(ISampleDataReader), provider => sampleDataReader); services.AddTransient <IAlbumRepository, AlbumRepository>(); services.AddTransient <IAlbumService, AlbumService>(); }