コード例 #1
0
        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);
            }
        }
コード例 #2
0
 public async Task SaveAsync(Human human)
 {
     await _dbContext.InsertOneAsync(human.Adapt <HumanDocument>());
 }