Beispiel #1
0
        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();
        }
Beispiel #2
0
        public void InsertIncident(Incident incident)
        {
            var collection = _db.GetCollection<Incident>("Incident");

            var result = collection.InsertOneAsync(incident);
        }