Skip to content

Instantly share code, notes, and snippets.

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 justinyoo/10abe76f492183df1b68d7fdc12455a5 to your computer and use it in GitHub Desktop.
Save justinyoo/10abe76f492183df1b68d7fdc12455a5 to your computer and use it in GitHub Desktop.
Dependency Injections on Azure Functions V2
public static class CoreGitHubRepositoriesHttpTrigger
{
public static IFunctionFactory Factory = new CoreFunctionFactory(new CoreAppModule());
[FunctionName("CoreGitHubRepositoriesHttpTrigger")]
public static async Task<IActionResult> Run([HttpTrigger(AuthorizationLevel.Function, "get", Route = "core/repositories")]HttpRequest req, ILogger log)
{
var result = await Factory.Create<IGitHubRepositoriesFunction>(log)
.InvokeAsync<HttpRequest, object>(req)
.ConfigureAwait(false);
return new OkObjectResult(result);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment