Example #1
0
        public async Task <ActionResult <IEnumerable <Products> > > Get()
        {
            try
            {
                var response = await productBusiness.All();

                if (!response.Success)
                {
                    return(this.StatusCode(StatusCodes.Status404NotFound));
                }
                return(response.Value.ToList());
            }
            catch (Exception ex)
            {
                return(this.StatusCode(StatusCodes.Status500InternalServerError));
            }
        }