コード例 #1
0
        public ActionResult AddNewStop(string location)
        {
            DatabaseInterface db = new DatabaseInterface();
            if (!db.IsStopLocationUnique(location))
                return Json("false");

            Stop stop = new Stop()
            {
                Id = ObjectId.GenerateNewId(),
                Location = location,
                StopId = db.GetNextStopId()
            };
            db.SaveStop(stop);
            return Json("true");
        }
コード例 #2
0
 public void SaveStop(Stop stop)
 {
     var coll = _database.GetCollection(_stopCollectionName);
     coll.Save(stop);
 }