Unit tests working; added logger adapter.

This commit is contained in:
Steve Smith
2017-04-30 08:06:06 -04:00
parent 6f908bb8e5
commit dfe0106ce3
6 changed files with 31 additions and 13 deletions

View File

@@ -15,12 +15,12 @@ namespace Microsoft.eShopWeb.Controllers
private readonly IHostingEnvironment _env;
private readonly ICatalogService _catalogService;
private readonly IImageService _imageService;
private readonly ILogger<CatalogController> _logger;
private readonly IAppLogger<CatalogController> _logger;
public CatalogController(IHostingEnvironment env,
ICatalogService catalogService,
IImageService imageService,
ILogger<CatalogController> logger)
IAppLogger<CatalogController> logger)
{
_env = env;
_catalogService = catalogService;

View File

@@ -13,6 +13,7 @@ using System.Text;
using Microsoft.AspNetCore.Http;
using ApplicationCore.Interfaces;
using Infrastructure.FileSystem;
using Infrastructure.Logging;
namespace Microsoft.eShopWeb
{
@@ -68,6 +69,7 @@ namespace Microsoft.eShopWeb
services.AddScoped<CatalogService>();
services.Configure<CatalogSettings>(Configuration);
services.AddSingleton<IImageService, LocalFileImageService>();
services.AddScoped(typeof(IAppLogger<>), typeof(LoggerAdapter<>));
services.AddMvc();
_services = services;