Ejemplo n.º 1
0
 public async Task <List <ProductEntity> > GetAll(int clientId)
 {
     // TODO: [TESTS] (ProductRepo.GetAll) Add tests
     return(await GetList <ProductEntity>(
                nameof(GetAll),
                _queries.GetAll(),
                new { ClientId = clientId }
                ));
 }
Ejemplo n.º 2
0
        public PaginationOutputDto GetAll(int page, int pageSize, string sortBy, string sortDirection)
        {
            var entities = _productQueries.GetAll(page, pageSize, sortBy, sortDirection).ToList();

            var pagedRecord = new PaginationOutputDto
            {
                Content      = _productCreateAssembler.FromEntityList(entities),
                TotalRecords = _productQueries.CountAll(),
                CurrentPage  = page,
                PageSize     = pageSize
            };

            return(pagedRecord);
        }
        public async Task <IActionResult> GetAll()
        {
            var result = await _productQueries.GetAll();

            return(Ok(result));
        }