public static BeaconDto AddBeacon(BeaconRequestDtos.BeaconAdd addDto) { using (var uow = new BlueprintUnitOfWork()) { // Check if the floorplan exists and the beacon has not been added var fp = uow.FloorPlans.Where(b => b.Id == addDto.FloorPlanId).FirstOrDefault(); if (fp == null) { return null; } // Map to Beacon object var beacon = addDto.ToEntity(); fp.Beacons.Add(beacon); uow.Save(); return beacon.ToDto(); } }
public object Put(BeaconRequestDtos.BeaconUpdateLocation put) { return BeaconServices.UpdateBeaconLocation(put.BeaconId, put.XPos, put.YPos); }
public object Post(BeaconRequestDtos.BeaconAdd add) { return BeaconServices.AddBeacon(add); }
public object Put(BeaconRequestDtos.BeaconUpdate put) { return BeaconServices.UpdateBeacon(put.BeaconId, put.Name, put.Address, put.IsNew); }
public object Get(BeaconRequestDtos.FindBeaconsForBlueprint bp) { return BeaconServices.FindBeaconsForBluePrint(bp.BluePrintId); }
public object Get(BeaconRequestDtos.FindBeaconsForFloorPlan get) { return BeaconServices.FindBeaconsForFloorplan(get.FloorPlanId); }
public object Get(BeaconRequestDtos.GetBeaconByAddress get) { return BeaconServices.GetBeacon(get.Address); }
public object Get(BeaconRequestDtos.GetBeaconById get) { return BeaconServices.GetBeacon(get.BeaconId); }
public object Delete(BeaconRequestDtos.BeaconDelete delete) { return BeaconServices.DeleteBeacon(delete.BeaconId, delete.UserId, delete.BluePrintId, delete.FloorplanId); }