Skip to content

Commit

Permalink
Updating credential settings
Browse files Browse the repository at this point in the history
  • Loading branch information
SnehaGunda authored May 22, 2018
1 parent 987a2b9 commit ac1c9de
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions MyTaskListApp/DAL/Dal.cs
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,7 @@ private IMongoCollection<MyTask> GetTasksCollection()
MongoIdentity identity = new MongoInternalIdentity(dbName, userName);
MongoIdentityEvidence evidence = new PasswordEvidence(password);

settings.Credentials = new List<MongoCredential>()
{
new MongoCredential("SCRAM-SHA-1", identity, evidence)
};
settings.Credential = new MongoCredential("SCRAM-SHA-1", identity, evidence);

MongoClient client = new MongoClient(settings);
var database = client.GetDatabase(dbName);
Expand All @@ -94,10 +91,8 @@ private IMongoCollection<MyTask> GetTasksCollectionForEdit()
MongoIdentity identity = new MongoInternalIdentity(dbName, userName);
MongoIdentityEvidence evidence = new PasswordEvidence(password);

settings.Credentials = new List<MongoCredential>()
{
new MongoCredential("SCRAM-SHA-1", identity, evidence)
};
settings.Credential = new MongoCredential("SCRAM-SHA-1", identity, evidence);

MongoClient client = new MongoClient(settings);
var database = client.GetDatabase(dbName);
var todoTaskCollection = database.GetCollection<MyTask>(collectionName);
Expand Down Expand Up @@ -126,4 +121,4 @@ protected virtual void Dispose(bool disposing)

# endregion
}
}
}

0 comments on commit ac1c9de

Please sign in to comment.