public async Task Handler(ILambdaContext context) { ITestClass test = services.GetService <ITestClass>(); await test.RunAsync(); //... }