コード例 #1
0
        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));
        }
コード例 #2
0
        public async Task <IActionResult> Get()
        {
            var deviceResults = await repository.GetDeviceEventsAsync();

            logger.LogInformation($"DevicesController - api/devices - getting from Cosmos");

            return(Ok(deviceResults));
        }
コード例 #3
0
ファイル: HomeController.cs プロジェクト: woodp/iot-guidance
        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));
        }