public JsonResult AddIncident() { var mongoDb = new MongoDbManager(""); var incident = new Incident { Date = new DateTime(), Description = "test 1234", Location = "loc", ReportedBy = "me" }; mongoDb.InsertIncident(incident); return new JsonResult(); }
public void InsertIncident(Incident incident) { var collection = _db.GetCollection<Incident>("Incident"); var result = collection.InsertOneAsync(incident); }