public IActionResult Get()
        {
            List <ProductItem> productItems;

            try
            {
                productItems = _productsServices.GetAllProducts().ToList();
            }
            catch (Exception oEx)
            {
                // TODO: if I have time to add logging...
                //_staticLoggerInstanceWrapper.LogError(GetType(), oEx);

                return(StatusCode(StatusCodes.Status500InternalServerError, oEx));
            }

            return(Ok(productItems));
        }
Пример #2
0
 public async Task <IEnumerable> GetAll()
 {
     return(await _service.GetAllProducts());
 }