public async Task UpdateMessageAsync(EmailMessage message) { await this.Collection.FindOneAndReplaceAsync(document => document.Id.Equals(message.Id.ToString()), message.AsDocument()); }
public async Task InsertMessageAsync(EmailMessage message) { await this.Collection.InsertOneAsync(message.AsDocument()); }