Using an async Find call in a WCF application (C# MongoDB Driver v2.2.2.10) causes timeouts from time to time.
This is what we use today:
public static async Task<T> FindOne<T>(this IMongoCollection<T> collection, FilterDefinition<T> filter = null, FindOptions options = null,
CancellationToken token = default(CancellationToken)) where T : class
{
return await collection.Find(filter, options).FirstOrDefaultAsync(token);
}
However, this tends to hang and this answer says I should add ConfigureAwait(false):
return await collection.Find(filter, options).FirstOrDefaultAsync(token).ConfigureAwait(false);
My question is, in a WCF context, is using ConfigureAwait(false) safe in an application that is heavily multi threaded?