public async Task SaveReport(Report report) { var reportDocument = report.Adapt <ReportDocument>(); if (reportDocument.Id == ObjectId.Empty) { await _dbContext.InsertOneAsync(reportDocument); } else { await _dbContext.ReplaceOneAsync(reportDocument); } }
public async Task SaveAsync(Human human) { await _dbContext.InsertOneAsync(human.Adapt <HumanDocument>()); }