Skip to content

Instantly share code, notes, and snippets.

@akki-s
Created October 31, 2018 03:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save akki-s/d7d0f87869276b3c8463b0f9e89efc56 to your computer and use it in GitHub Desktop.
Save akki-s/d7d0f87869276b3c8463b0f9e89efc56 to your computer and use it in GitHub Desktop.
[FunctionName("GetTimeZones")]
public static async Task<IActionResult> Run([HttpTrigger(AuthorizationLevel.Anonymous, "get", Route = "timezones")]HttpRequest req, ILogger log)
{
var serviceProvider = Bootstrap.ConfigureServices();
log.LogInformation("GET TIMEZONES");
var timeZoneService = ServiceProvider.GetService<ITimeZoneService>();
var timeZones = await timeZoneService.GetTimeZones().ConfigureAwait(false);
return new OkObjectResult(timeZones ?? new List<string>());
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment