Created
May 10, 2019 23:34
-
-
Save msajid/4b6487efea17934efdb9daed84991aa4 to your computer and use it in GitHub Desktop.
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
using Microsoft.AspNetCore.Http; | |
using Microsoft.AspNetCore.Mvc; | |
using Microsoft.Azure.WebJobs; | |
using Microsoft.Azure.WebJobs.Extensions.Http; | |
using System.Threading.Tasks; | |
namespace AzureFunctionAppWithDIAndScrutor | |
{ | |
public class SimpleFunction | |
{ | |
private readonly ISomeService service; | |
public SimpleFunction(ISomeService service) | |
{ | |
this.service = service; | |
} | |
[FunctionName("SimpleFunction")] | |
public async Task<IActionResult> Run( | |
[HttpTrigger(AuthorizationLevel.Anonymous, "get", "post", Route = null)] HttpRequest req) | |
{ | |
service.DoSomething(); | |
return new OkObjectResult(new { hello = "injection"}); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment