-
-
Save justinyoo/cbf011b638bff5a2c33c96b5bb3ca644 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 async 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 = await service.GetUsersAsync(entities).ConfigureAwait(false); | |
log.Info(JsonConvert.SerializeObject(users)); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment