@using Front.Services @using Shared.DTOs @using Shared.DTOs.Serch @inject HttpClientController hc; @context.Date @context.Title @context.typeName @context.Value @code { private async Task> DocumentDataProvider(GridDataProviderRequest request) { string sortString = ""; SortDirection sortDirection = SortDirection.None; if (request.Sorting is not null && request.Sorting.Any()) { // Note: Multi column sorting is not supported at this moment sortString = request.Sorting.FirstOrDefault()!.SortString; sortDirection = request.Sorting.FirstOrDefault()!.SortDirection; } var itemsearch = new GridDataProviderRequestDto() { // CancellationToken = request.CancellationToken, Filters = request.Filters.Select(s => new Shared.DTOs.Serch.FilterItem { Oper = s.Operator.ToString(), PropertyName = s.PropertyName, Value = s.Value }).ToList(), PageNumber = request.PageNumber, PageSize = request.PageSize, //sortString = sortString, // SortDirection = sortDirection.ToString() }; var model = new PagingDto(0, 0, new List()); var rsp = await hc.Post($"Orders/GetCreditDocuments", itemsearch); if (rsp.IsSuccessStatusCode) { model = await rsp.Content.ReadFromJsonAsync>(); } return await Task.FromResult(new GridDataProviderResult { Data = model.list, TotalCount = model.RowCount }); // if (request.Sorting is not null && request.Sorting.Any()) // { // // Note: Multi column sorting is not supported at this moment // sortString = request.Sorting.FirstOrDefault()!.SortString; // sortDirection = request.Sorting.FirstOrDefault()!.SortDirection; // } // var result = await _customerService.GetCustomersAsync(request.Filters, request.PageNumber, request.PageSize, sortString, sortDirection, request.CancellationToken); // return await Task.FromResult(new GridDataProviderResult { Data = result.Item1, TotalCount = result.Item2 }); } }