Exemplo n.º 1
0
        public async Task <PaginatedResponse <TypeProduit> > GetPaginatedTypesProduit(DataTableParams @params)
        {
            try
            {
                var pagination = new PagingParams
                {
                    PageNumber  = @params.start,
                    PageSize    = @params.length,
                    SearchQuery = @params.search,
                    OpenDate    = @params.openDate,
                    CloseDate   = @params.closeDate,
                    OrderColumn = @params.orderColumn,
                    OrderDir    = @params.orderDir
                };

                var result = await _stockApi.GetPaginatedTypesProduit(pagination);

                return(result.Content);
            }
            catch (ApiException e)
            {
                throw new StockApiException(e.Message);
            }
            catch (Exception e)
            {
                _logger.LogError(e.Message);
                throw;
            }
        }