public IActionResult Shop() { var results = _repository.GetAllProducts(); return(View(results)); }
public IActionResult Get() { try { return(Ok(_mapper.Map <IEnumerable <Product>, IEnumerable <ProductViewModel> >(_repository.GetAllProducts()))); } catch (Exception ex) { _logger.LogInformation($"Failed to get products: {ex}"); return(BadRequest("Failed to get a products")); } }