/* Returns all beacons in DB */ public List <Beacon> GetBeacons() { using (IndoorPositioningContext db = new IndoorPositioningContext()) { var beacons = db.Beacons.ToList(); return(beacons); } }
/* Returns all gateways in DB */ public List <Gateway> GetGateways() { using (IndoorPositioningContext db = new IndoorPositioningContext()) { var gateways = db.Gateways.ToList(); return(gateways); } }
/* Returns all environments in DB */ public List <Environment> GetEnvironments() { using (IndoorPositioningContext db = new IndoorPositioningContext()) { var beacons = db.Environments.ToList(); return(beacons); } }
/* Deletes the given beacon */ public Beacon DeleteBeacon(Beacon beacon) { using (IndoorPositioningContext db = new IndoorPositioningContext()) { db.Beacons.Remove(beacon); db.SaveChanges(); return(beacon); } }
/* Adds new beacon */ public Beacon NewBeacon(Beacon beacon) { using (IndoorPositioningContext db = new IndoorPositioningContext()) { db.Beacons.Add(beacon); db.SaveChanges(); return(beacon); } }
/* Returns the beacon with given id */ public Beacon GetBeaconById(int id) { using (IndoorPositioningContext db = new IndoorPositioningContext()) { var beacon = db.Beacons .Where(b => b.BeaconId == id) .FirstOrDefault(); return(beacon); } }
/* Deletes the given gateway */ public Gateway DeleteGateway(Gateway gateway) { using (IndoorPositioningContext db = new IndoorPositioningContext()) { db.Gateways.Remove(gateway); db.SaveChanges(); return(gateway); } }
/* Updates the given environment */ public Environment UpdateEnvironment(Environment environment) { using (IndoorPositioningContext db = new IndoorPositioningContext()) { db.Environments.Update(environment); db.SaveChanges(); return(environment); } }
/* Adds new gateway */ public Gateway NewGateway(Gateway gateway) { using (IndoorPositioningContext db = new IndoorPositioningContext()) { db.Gateways.Add(gateway); db.SaveChanges(); return(gateway); } }
/* Adds new fingerprinting record */ public Fingerprinting NewFingerprint(Fingerprinting fingerprinting) { using (IndoorPositioningContext db = new IndoorPositioningContext()) { db.Fingerprintings.Add(fingerprinting); db.SaveChanges(); return(fingerprinting); } }
/* Returns the gateway with given id */ public Gateway GetGatewayById(int id) { using (IndoorPositioningContext db = new IndoorPositioningContext()) { var gateway = db.Gateways .Where(b => b.GatewayId == id) .FirstOrDefault(); return(gateway); } }
/* Finds the beacon with macAddress */ public Beacon GetBeacon(string macAddress) { using (IndoorPositioningContext db = new IndoorPositioningContext()) { var beacon = db.Beacons .Where(b => b.MACAddress == macAddress) .FirstOrDefault(); return(beacon); } }
/* Finds the gateway with macAddress */ public Gateway GetGateway(string macAddress) { using (IndoorPositioningContext db = new IndoorPositioningContext()) { var gateway = db.Gateways .Where(b => b.MACAddress == macAddress) .FirstOrDefault(); return(gateway); } }
/* Gets the fingerprinting records of the given environment */ public List <Fingerprinting> GetFingerprinting(int environmentId) { using (IndoorPositioningContext db = new IndoorPositioningContext()) { var fingerprintings = db.Fingerprintings .Where(b => b.EnvironmentId == environmentId) .OrderBy(b => b.Xaxis) .ThenBy(b => b.Yaxis) .ThenBy(b => b.Timestamp) .ThenBy(b => b.GatewayId) .ToList(); return(fingerprintings); } }
public TrainingValuesHandler(IndoorPositioningContext db) { this.db = db; }
public Parsers(IndoorPositioningContext dbcontext) { db = dbcontext; }
public KnnsHandler(IndoorPositioningContext db) { this.db = db; }
public StoreysHandler(IndoorPositioningContext db) { this.db = db; }
public SpacesHandler(IndoorPositioningContext dbcontext) { db = dbcontext; }
public BeaconsHandler(IndoorPositioningContext dbcontext) { db = dbcontext; }
public BuildingsHandler(IndoorPositioningContext dbcontext) { db = dbcontext; }
public TrackerLocationsHandler(IndoorPositioningContext db) { this.db = db; }
public AddressesHandler(IndoorPositioningContext dbcontext) { db = dbcontext; }