Esempio n. 1
0
        /// <summary>
        /// Get all products.
        /// </summary>
        /// <returns>A <see cref="Task"/> representing the asynchronous operation.</returns>
        public async Task <IActionResult> GetAll()
        {
            var result = await productsQueries.GetAllAsync();

            if (result == null)
            {
                return(NotFound());
            }

            return(Ok(result));
        }
Esempio n. 2
0
 public async Task <IActionResult> Get()
 {
     return(Ok(await _queries.GetAllAsync()));
 }