public JsonResult GetAllStations() //Have to be changed so it get parsed in the string for connection { IMongoCollection <Station> collection = conn.ConnectToStation("Trafik_DB", "Stations"); var filt = Builders <Station> .Filter.Where(m => m.name != null); return(Json(collection.Find(filt).ToList())); }
public JsonResult GetAllStations() //Have to be changed so it get parsed in the string for connection { IMongoCollection <Station> collection = conn.ConnectToStation("Trafik_DB", "Stations"); var filt = Builders <Station> .Filter.Where(m => m.name != null); List <Station> stations = collection.Find(filt).ToList(); List <Result> result = new List <Result>(); foreach (Station item in stations) { result.Add(new Result(item.name, item.areacode)); } return(Json(result)); }
public void InsertStation(int areacode, string name, DateTime installed, string equipmentType, double latitude, double longitude) { IMongoCollection <Station> collection = conn.ConnectToStation("Trafik_DB", "Stations"); collection.InsertOne(new Station(areacode, name, installed, equipmentType, latitude, longitude)); }
public void InsertStation(string name, int areacode) { IMongoCollection <Station> collection = conn.ConnectToStation("Trafik_DB", "Stations"); collection.InsertOne(new Station(name, areacode)); }