You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would like to perform a generic search like this:
var table = context.GetCollection<T>();
var query = table.Query();
if (typeof(INamedItem).IsAssignableFrom(typeof(T)))
{
var myItems = query as ILiteQueryable<INamedItems>;
// now run a filter on the ILiteQueryable<INamedItem>
query = myItems as ILiteQueryable<T>;
}
But, myItems is always null. I've been using the same approach with EFCore (where I work with IQueryable<T> instead of ILiteQueryable<T>) - what do I need to do do get a properly typed ILiteQueryable so I can use Linq syntax to run queries rather than to have to write BSonExpressions?
The text was updated successfully, but these errors were encountered:
I would like to perform a generic search like this:
But,
myItems
is always null. I've been using the same approach with EFCore (where I work withIQueryable<T>
instead ofILiteQueryable<T>
) - what do I need to do do get a properly typed ILiteQueryable so I can use Linq syntax to run queries rather than to have to write BSonExpressions?The text was updated successfully, but these errors were encountered: