fullstackhero / dotnet-starter-kit

Production Grade Cloud-Ready .NET 8 Starter Kit (Web API + Blazor Client) with Multitenancy Support, and Clean/Modular Architecture that saves roughly 200+ Development Hours! All Batteries Included.

Home Page:https://fullstackhero.net/dotnet-webapi-boilerplate/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[BUG] _repository.PaginatedListAsync with spec error

gmbeas opened this issue · 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)