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"); }
public void SaveStop(Stop stop) { var coll = _database.GetCollection(_stopCollectionName); coll.Save(stop); }