I am using MongoDB and .Net in visual studio to make a web API. It works but I'm trying to make this asynchronous
I am trying to get the most recent record added to a collection
public T LoadRecentRecord<T>(string collectionName)
{
var collection = db.GetCollection<T>(collectionName);
return collection.Find(new BsonDocument()).Sort("{_id:-1}").Limit(1).First();
}