Is AsQueryable method departed in new Mongodb C# driver 2.0rc?

前端 未结 3 1107
无人及你
无人及你 2021-02-12 10:52

First of all I\'m new to MongoDb. In MongoDb C# driver 1.9.x, i can take collections as queryable with AsQueryable method like this.

        var db = client.Get         


        
3条回答
  •  一生所求
    2021-02-12 11:23

    While other answers indicated that the early version 2 releases of the drivers didn't include the AsQueryable this is now available in the latest version of the drivers (I've not checked exactly which version introduced it).

    The method is found in MongoDB.Driver.IMongoCollectionExtensions and can be invoked as you would expect. That is:

    IMongoCollection collection = ...;
    IMongoQueryable queryable = collection.AsQueryable();
    

提交回复
热议问题