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 <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)); }