Skip to content

Instantly share code, notes, and snippets.

@msajid
Created May 10, 2019 23:34
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 msajid/4b6487efea17934efdb9daed84991aa4 to your computer and use it in GitHub Desktop.
Save msajid/4b6487efea17934efdb9daed84991aa4 to your computer and use it in GitHub Desktop.
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