Skip to content

Instantly share code, notes, and snippets.

@jiimaho
Created October 24, 2021 16:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jiimaho/b10c742b913e9130826d975ee31d69f1 to your computer and use it in GitHub Desktop.
Save jiimaho/b10c742b913e9130826d975ee31d69f1 to your computer and use it in GitHub Desktop.
public async Task FunctionHandler(SQSEvent evnt, ILambdaContext context)
{
// Calling CreateScope() here is required to resolve scoped services correctly
using var scope = ServiceProvider.CreateScope();
await scope.ServiceProvider.GetService<App>().Run(evnt);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment