示例#1
0
 public static IActionResult Run([HttpTrigger(AuthorizationLevel.Function, "get", "post", Route = null)]
                                 HttpRequest req, TraceWriter log,
                                 [Inject("registration1")] ITestItByName testitbyName1,
                                 [Inject("registration2")] ITestItByName testitbyName2)
 {
     log.Info("C# HTTP trigger function processed a request.");
     return(new OkObjectResult($"Hello, this is Function2. Dependency injection sample returns \n'{testitbyName1.CallMe()}', \n'{testitbyName2.CallMe()}'"));
 }
示例#2
0
 public static async Task <HttpResponseMessage> Run([HttpTrigger(AuthorizationLevel.Function, "get", "post", Route = null)]
                                                    HttpRequestMessage req, TraceWriter log,
                                                    [Inject("registration1")] ITestItByName testitbyName1,
                                                    [Inject("registration2")] ITestItByName testitbyName2)
 {
     log.Info("C# HTTP trigger function processed a request.");
     return(req.CreateResponse(HttpStatusCode.OK,
                               $"Hello, this is Function2. Dependency injection sample returns \n'{testitbyName1.CallMe()}', \n'{testitbyName2.CallMe()}'"));
 }