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)); }
public IHttpActionResult GetAllStations() { return(Ok(_stationRepo.GetAllStations())); }