示例#1
0
        public async Task <APIResult> GetAll()
        {
            var rs = await productQueries.GetAllAsync();

            return(new APIResult()
            {
                Result = 0,
                Data = rs
            });
        }
        public async Task <ActionResult> GetByAsync()
        {
            try
            {
                var products = await _productQueries.GetAllAsync();

                return(Ok(products));
            }
            catch
            {
                return(NotFound());
            }
        }