コード例 #1
0
        public static async Task <IActionResult> Run(
            [HttpTrigger(AuthorizationLevel.Anonymous, "get")] HttpRequest req,
            ILogger log,
            ExecutionContext context
            )
        {
            log.LogInformation("Stations request");

            var stationsRepository = new StationsRepository(new CloudTableClientFactory());

            var stations = await stationsRepository.GetAllStations();

            var result = stations.Select(it => new StationModel(it.RowKey, it.Name, it.Latitude, it.Longitude));

            return(new OkObjectResult(result));
        }
コード例 #2
0
 public IHttpActionResult GetAllStations()
 {
     return(Ok(_stationRepo.GetAllStations()));
 }