How To Query Collections Using Linq Methods?

Hey Thank you so much! That made things very clear for me!

I tried to apply this but when I code

var peopleList = query.ToList<string>();

I get the error:

Cannot resolve method ‘ToList()’, candidates are: System.Collections.Generic.List ToList(this MongoDB.Driver.IAsyncCursorSource, System.Threading.CancellationToken) (in class IAsyncCursorSourceExtensions) System.Collections.Generic.List ToList(this System.Collections.Generic.IEnumerable) (in class Enumerable)

so instead I coded this:

> var peopleList = query.ToList<string>(CancellationToken.None);

however this time I got this error:

Cannot convert instance argument type ‘{MongoDB.Driver.Linq.IMongoQueryable,System.Collections.Generic.IEnumerable,System.Linq.IQueryable}’ to ‘MongoDB.Driver.IAsyncCursorSource’

So do you know how I can solve this? Frankly I would like to find out how to map the peopleList to something like

var peopleList = query.ToList<personDTO>(CancellationToken.None);

How can this be done?

Thanks!