Updated logging

Moved images to use static files
Got login working with demo user.
This commit is contained in:
Steve Smith
2017-07-26 17:30:29 -04:00
parent fb95b37da8
commit af406f86ef
21 changed files with 70 additions and 40 deletions

View File

@@ -89,7 +89,7 @@ namespace Microsoft.eShopWeb.Controllers
}
else
{
return RedirectToAction(nameof(CatalogController.Index), "Home");
return RedirectToAction(nameof(CatalogController.Index), "Catalog");
}
}

View File

@@ -56,21 +56,21 @@ namespace Microsoft.eShopWeb.Controllers
return View(vm);
}
[HttpGet("[controller]/pic/{id}")]
public IActionResult GetImage(int id)
{
byte[] imageBytes;
try
{
imageBytes = _imageService.GetImageBytesById(id);
}
catch (CatalogImageMissingException ex)
{
_logger.LogWarning($"No image found for id: {id}");
return NotFound();
}
return File(imageBytes, "image/png");
}
//[HttpGet("[controller]/pic/{id}")]
//public IActionResult GetImage(int id)
//{
// byte[] imageBytes;
// try
// {
// imageBytes = _imageService.GetImageBytesById(id);
// }
// catch (CatalogImageMissingException ex)
// {
// _logger.LogWarning($"No image found for id: {id}");
// return NotFound();
// }
// return File(imageBytes, "image/png");
//}
public IActionResult Error()