public IActionResult Details(int id) { //if (id == null) //{ // return NotFound(); //} //Get the database connection //mongoDatabase = GetMongoDatabase(); //fetch the details from CustomerDB and pass into view //Customer customer = mongoDatabase.GetCollection<Customer>("Customers").Find<Customer>(k => k.CustomerId == id).FirstOrDefault(); var customer = _mongo.Get(Convert.ToInt16(id)); if (customer == null) { return(NotFound()); } return(View(customer)); }