I have IMongoCollection variable which is "_collection".
public IQueryable<T> GetBy(Expression<Func<T, bool>> predicate = null)
{
if (predicate != null)
{
return _collection.AsQueryable().Where(x => x.Status > 0).Where(predicate);
}
else
{
return _collection.AsQueryable().Where(x => x.Status > 0);
}
}
in ASP.NET Core
Are the records coming when i call the .AsQueryAble() method ? Or do we have to call .ToList() or something like this method to get records from database (MongoDB)