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

            var result = collection.InsertOneAsync(incident);
        }