What you're asking doesn't make much sense.
Task<Predicate<int>>
is an asynchronous method that returns a predicate.
What you're trying to do is write a predicate that acts asynchronously. In other words, Func<int, Task<bool>>
would be an asynchronous predicate.
private Func<int, Task<bool>> GetQueryFilter(string queryText)
{
return new Func<int, Task<bool>>(async (id) =>
{
...
};
}
But an actual asynchronous predicate probably won't work well for whatever code is calling this. You'll have to determine what the best way is to handle that.