dotnet-starter-kit icon indicating copy to clipboard operation
dotnet-starter-kit copied to clipboard

[BUG] _repository.PaginatedListAsync with spec error

Open gmbeas opened this issue 2 years ago • 0 comments

Hello, I'm trying to use it, but it gives me an error, is it because the field I want to search or filter is a list?

PARAMETER

{"advancedSearch":{"fields":["otherDocuments.ref"],"keyword":"20"},"keyword":"7778","pageNumber":0,"pageSize":10,"orderBy":["xml descending"],]}}

`public class AllDocumentsBySearchRequestSpec : EntitiesByPaginationFilterSpec<Documents, AllDocumentsResponse> { public AllFacturasdBySearchRequestSpec(AllFacturasRequest request) : base(request) => Query

        .Include(x => x.OtherDocuments) //List<OtherDocuments>
        .OrderBy(c => c.ExisteXml, !request.HasOrderBy())
    ;

}`

var spec = new AllDocumentsdBySearchRequestSpec(request); return await _repository.PaginatedListAsync(spec, request.PageNumber, request.PageSize, cancellationToken: cancellationToken);

ERROR: at System.Linq.Expressions.Expression.PropertyOrField(Expression expression, String propertyOrFieldName) at Application.Common.Specification.SpecificationBuilderExtensions.GetPropertyExpression(String propertyName, ParameterExpression parameter)

gmbeas avatar Sep 11 '23 18:09 gmbeas