Scale unique answer tracking
This commit is contained in:
@@ -8,13 +8,9 @@ public class QuestionReportStore
|
||||
{
|
||||
private readonly IMongoCollection<QuestionReport> _reports;
|
||||
|
||||
public QuestionReportStore(IConfiguration cfg)
|
||||
public QuestionReportStore(MongoDatabaseProvider mongo)
|
||||
{
|
||||
var connectionString = cfg["MongoDB:ConnectionString"] ?? "mongodb://127.0.0.1:27017";
|
||||
var databaseName = cfg["MongoDB:DatabaseName"] ?? "GameDb";
|
||||
var client = new MongoClient(connectionString);
|
||||
var database = client.GetDatabase(databaseName);
|
||||
_reports = database.GetCollection<QuestionReport>("QuestionReports");
|
||||
_reports = mongo.Database.GetCollection<QuestionReport>("QuestionReports");
|
||||
|
||||
_reports.Indexes.CreateMany(
|
||||
[
|
||||
|
||||
Reference in New Issue
Block a user