Samir Bhogayta

Samir Bhogayta

  • 670
  • 1.4k
  • 813.4k

How to connect MongoDB using asp.net mvc

Dec 4 2019 1:14 AM
Hello, I was followed all the steps from following article.
https://www.c-sharpcorner.com/article/create-a-free-mongodb-atlas-cluster-and-connect-with-mvc/
 
But, still I can't able to connect with MongoDB using asp.net mvc.
 
My code is as follows.
 
public async Task<IEnumerable<Permit>> GetPermits()
{
try
{
return await db.Permit.Find(_ => true).ToListAsync();
}
catch
{
throw new NotImplementedException();
}
}
 
 
Kindly help me out of this. 

Answers (3)