C#C
C#2y ago
SWEETPONY

System.InvalidOperationException: The LINQ expression 'DbSet<WorkingTask>() .Where(w => new Work

I have following code:
[UsePaging]
    [UseProjection]
    [UseFiltering]
    [UseSorting]
    [Authorize(Roles = [Permissions.Rms.Task.Read])]
    public IQueryable<WorkingTask> WorkingTasks([Service(ServiceKind.Resolver)] ReadModelDbContext dbContext, IResolverContext context, [Service] NpgsqlHealthChecker npgsqlHealthChecker)
    {
        var workingTasks = dbContext.WorkingTasks
            .AsQueryable()
            .Project(context)
            .Filter(context)
            .Sort(context)
            .ToList(); // Force client-side evaluation

        return workingTasks.AsQueryable();
    }


I don't know why but I always get error after .Sort(context).ToList();. how to fix this?
Was this page helpful?