Skip to content

Commit

Permalink
Merge pull request #3 from SnehaGunda/Mongosample
Browse files Browse the repository at this point in the history
Mongosample Update
  • Loading branch information
SnehaGunda authored May 23, 2018
2 parents 987a2b9 + 785639d commit ea3508a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 13 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
}
}
}
8 changes: 4 additions & 4 deletions MyTaskListApp/packages.config
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,12 @@
<package id="Microsoft.Web.Infrastructure" version="1.0.0.0" targetFramework="net452" />
<package id="Modernizr" version="2.6.2" targetFramework="net452" />
<package id="mongocsharpdriver" version="2.3.0" targetFramework="net452" />
<package id="MongoDB.Bson" version="2.4.0" targetFramework="net452" />
<package id="MongoDB.Driver" version="2.3.0" targetFramework="net452" />
<package id="MongoDB.Driver.Core" version="2.3.0" targetFramework="net452" />
<package id="MongoDB.Bson" version="2.6.1" targetFramework="net452" />
<package id="MongoDB.Driver" version="2.6.1" targetFramework="net452" />
<package id="MongoDB.Driver.Core" version="2.6.1" targetFramework="net452" />
<package id="Newtonsoft.Json" version="6.0.4" targetFramework="net452" />
<package id="Owin" version="1.0" targetFramework="net452" />
<package id="Respond" version="1.2.0" targetFramework="net452" />
<package id="System.Runtime.InteropServices.RuntimeInformation" version="4.0.0" targetFramework="net452" />
<package id="WebGrease" version="1.5.2" targetFramework="net452" />
</packages>
</packages>

0 comments on commit ea3508a

Please sign in to comment.