Exemplo n.º 1
0
 public async Task <ICollection <ProductModel> > GetAllProductsAsync()
 {
     using (var uow = UnitOfWorkFactory.Create())
     {
         var query = new AllProductsQuery(UnitOfWorkFactory);
         return(await query.ExecuteAsync());
     }
 }
Exemplo n.º 2
0
        public async Task <IActionResult> GetAll()
        {
            var query = new AllProductsQuery();

            var result = await DispatchAsync(query);

            return(Ok(result));
        }