-
-
Save justinyoo/c46e18f9d29af94e97f292d00f061a8d to your computer and use it in GitHub Desktop.
Managing Dependencies in Azure Functions
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
#load "..\Shared\ServiceLocator.csx" | |
#r "Newtonsoft.Json" | |
using System; | |
using Functions.EntityModels; | |
using Functions.Services; | |
using Newtonsoft.Json; | |
public static void Run(string input, TraceWriter log) | |
{ | |
log.Info($"C# manually triggered function called with input: {input}"); | |
var instance = locator.Instance; | |
var service = instance.GetInstance<IUserService>(); | |
var entities = new List<User> | |
{ | |
new User() { UserId = Guid.NewGuid(), FirstName = "Jane", LastName = "Doe" }, | |
new User() { UserId = Guid.NewGuid(), FirstName = "Joe", LastName = "Bloggs" } | |
}; | |
var users = service.GetUsers(entities); | |
log.Info(JsonConvert.SerializeObject(users)); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment