/// <summary> /// Method useful for asynchronously adding a MongoTestEntry object to MongoDB using the TestFixture's MongoWriterTask class. /// </summary> /// <remarks>This asynchronous implementation utilizes System.Threading.Tasks</remarks> protected Task AddMongoEntryAsyncTask(string message = "Hello World", string collectionName = MONGO_COLLECTION_1_NAME) { Entry mongoEntry = new Entry(); mongoEntry.Message = message; mongoEntry.TimeStamp = DateTime.Now; return(_asyncWriter.WriteAsync <Entry>(collectionName, mongoEntry)); }
/// <summary> /// Method useful for asynchronously adding a MongoTestEntry object to MongoDB using the TestFixture's MongoWriterAsync<T> class /// </summary> /// <remarks>Uses async System.Threading.Task</remarks> protected void AddMongoEntryAsyncTaskT(string message = "Hello World", string collectionName = MONGO_COLLECTION_1_NAME) { Entry mongoEntry = new Entry(); mongoEntry.Message = message; mongoEntry.TimeStamp = DateTime.Now; _asyncWriterT.WriteAsync(collectionName, mongoEntry); }
public Task WriteAsync <T>(string collectionName, T entry) { return(_asyncWriter.WriteAsync <T>(collectionName, entry)); }