Ejemplo n.º 1
0
 public AlbumsRepository(ILogger logger, HttpClient httpClient, IOptions <JsonPlaceholderOptions> jsonPlaceholderOptions, IPhotosRepository photosRepository)
 {
     _logger                 = (logger?.ForContext <AlbumsRepository>()).ThrowIfNull(nameof(logger));
     _httpClient             = httpClient.ThrowIfNull(nameof(httpClient));
     _photosRepository       = photosRepository.ThrowIfNull(nameof(photosRepository));
     _jsonPlaceholderOptions = jsonPlaceholderOptions?.Value.ThrowIfNull(nameof(jsonPlaceholderOptions));
 }
Ejemplo n.º 2
0
 public AlbumsController(ILogger logger, IAlbumsRepository albumsRepository, IPhotosRepository photosRepository)
 {
     _logger           = (logger?.ForContext <AlbumsController>()).ThrowIfNull(nameof(logger));
     _albumsRepository = albumsRepository.ThrowIfNull(nameof(albumsRepository));
     _photosRepository = photosRepository.ThrowIfNull(nameof(photosRepository));
 }