LambdaStartupAttribute support for Configure method. #1688
-
Hi, Thanks |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
@manuquintero Good morning. Per my analysis and available documentation,
...
namespace SomeNamespace
{
public class Functions_Add_Generated
{
private readonly ServiceProvider serviceProvider;
public Functions_Add_Generated()
{
SetExecutionEnvironment();
var services = new ServiceCollection();
...
var startup = new LambdaAnnotations_Issue1368.Startup();
startup.ConfigureServices(services);
serviceProvider = services.BuildServiceProvider();
}
public Amazon.Lambda.APIGatewayEvents.APIGatewayHttpApiV2ProxyResponse Add(Amazon.Lambda.APIGatewayEvents.APIGatewayHttpApiV2ProxyRequest __request__, Amazon.Lambda.Core.ILambdaContext __context__)
{
...
}
}
Based on above understanding, I'm unsure if we could configure HTTP request pipeline to invoke Reference example (using both programming models): https://github.com/awsdocs/aws-doc-sdk-examples/tree/main/dotnetv3/cross-service/PhotoAssetManager CCing @normj for validating the findings and any further inputs. Thanks, |
Beta Was this translation helpful? Give feedback.
@manuquintero Good morning. Per my analysis and available documentation,
Amazon.Lambda.Annotations.LambdaStartup
attribute causes source generation process to invoke <>.ConfigureServices() in the generated code for LambdaFunctions. Below is an example: