Created
June 9, 2019 11:44
-
-
Save kasunkv/9bf641f82e7ea101eb59b3a0ed8198c3 to your computer and use it in GitHub Desktop.
Construction Injecting the Dependencies in to Azure Function.
This file contains hidden or 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
namespace Function.DependencyInjection.Timer | |
{ | |
public class TimeFunction | |
{ | |
private readonly IHelloService _helloService; | |
public TimeFunction(IHelloService helloService) | |
{ | |
_helloService = helloService; | |
} | |
[FunctionName("TimeFunction")] | |
public void Run([TimerTrigger("0 */5 * * * *")]TimerInfo myTimer, ILogger log) | |
{ | |
log.LogInformation($"OUTPUT: {_helloService.SayHello("Kasun Kodagoda")}"); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment