public async Task <IActionResult> GetDevices(double swLon, double swLat, double neLon, double neLat) { logger.LogInformation($"In GetDevices action. params = ({swLon},{swLat},{neLon},{neLat})"); var results = await repository.GetDeviceEventsAsync(swLon, swLat, neLon, neLat); return(Ok(results)); }
public async Task <IActionResult> Get() { var deviceResults = await repository.GetDeviceEventsAsync(); logger.LogInformation($"DevicesController - api/devices - getting from Cosmos"); return(Ok(deviceResults)); }
public async Task <IActionResult> GetDevices(double swLon, double swLat, double neLon, double neLat) { logger.LogInformation($"In GetDevices action. params = ({swLon},{swLat},{neLon},{neLat})"); Polygon rectangularArea = new Polygon( new[] { new LinearRing(new [] { new Position(neLon, neLat), // NE new Position(swLon, neLat), // NW new Position(swLon, swLat), // SW new Position(neLon, swLat), // SE new Position(neLon, neLat) }) }); var results = await repository.GetDeviceEventsAsync(rectangularArea); return(Ok(results)); }