In context of dot net core c# Linq queries
I want to query for part of the object Id.
The ID is represented in Mongodb as object and in POCO as string.
Query the full Id works fine but the following does not work
var result= await _dataServiceJobONSITE.QueryAsync(j => j.Id.Contains("a")).ConfigureAwait(false);
where QueryAsync is
public async Task<IList<T>> QueryAsync(Expression<Func<T, bool>> predicate)
{
try
{
//var result = await Collection.FindAsync(predicate).ConfigureAwait(false);
var result = Collection.AsQueryable().Where(predicate);
var batch = await result.ToListAsync().ConfigureAwait(false);
return batch;
}
catch (Exception ex)
{
return new List<T>() { };
}
}