Home:ALL Converter>Mongodb c# library Async

Mongodb c# library Async

Ask Time:2013-01-18T10:50:56         Author:Alvin

Json Formatter

I am using ASP.net Web API and MongoDB to create a simple service.

I am using the official Mongodb C# library.

How can I make it Async? I think the official Mongodb C# library does not support Async.

Can I just make the controller Async but not the select statement?

Controller:

 public IQueryable<Test> GetAllPlaces()
 {
     return _test.GetAllPlaces().AsQueryable();
 }

Select from mongodb database:

public IEnumerable<Test> GetAllPlaces()
{
     return _test.FindAll();
}

Thank you.

Author:Alvin,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/14391697/mongodb-c-sharp-library-async
D.Rosado :

Bit old question, but a full async MongoDB driver for C# is coming up in Nov 2013:\n\nhttps://jira.mongodb.org/browse/CSHARP-138\n\nedit- As Eugene said, the driver is still under development. There are some experimental projects on Github, while we wait for the official one\n\nhttps://github.com/rstam/mongo-async-csharp-driver\nhttps://github.com/andrebires/mongo-csharp-driver\n\n02-Apr-2015 Update:\n\n2.0 is out!: Nuget Link\nBut be aware that async GridFS is not supported yet, you'll need to keep using the legacy package to work with it, until they release it, probably in version 2.1\n\n(thanks paqogomez for the heads up)",
2013-07-31T08:47:18
WiredPrairie :

While you could make it async, doing so won't provide you any real performance gains as the underlying library isn't Async. There's a lot more to it and is described well here. The general answer is \"no.\"",
2013-01-18T12:09:03
yy