コード例 #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 <ReplaceOneResult> ReplaceOneAsync <T>(T @object, Expression <Func <T, bool> > expression, UpdateOptions options, IMongoDBStateContext stateContext = null) where T : class
 {
     return(await context.ReplaceOneAsync <T>(@object, expression, options, stateContext));
 }