Last active
August 28, 2017 12:29
-
-
Save justinyoo/835a482a72f744d0a869531b4f63899b to your computer and use it in GitHub Desktop.
Testing Serverless Applications - Part 1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static class GetArmTemplateDirectoriesHttpTriggerWithServiceLocator | |
{ | |
// Declare a static IServiceLocator property. | |
public static IServiceLocator ServiceLocator { get; set; } = new ServiceLocatorBuilder().RegisterModule<AppModule>().Build(); | |
public static async Task<HttpResponseMessage> Run(HttpRequestMessage req, ILogger log) | |
{ | |
// Resolve the service instance through the service locator property. | |
var service = ServiceLocator.GetInstance<IGitHubService>(); | |
var query = GetQuery(req); | |
var models = await service.GetArmTemplateDirectoriesAsync(query) | |
.ConfigureAwait(false); | |
return req.CreateResponse(HttpStatusCode.OK, models); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment