File tree Expand file tree Collapse file tree 3 files changed +20
-4
lines changed
src/Amazon.Lambda.AspNetCoreServer Expand file tree Collapse file tree 3 files changed +20
-4
lines changed Original file line number Diff line number Diff line change 2222namespace Amazon . Lambda . AspNetCoreServer
2323{
2424 /// <summary>
25- /// ApiGatewayFunction is the base class that is implemented in a ASP.NET Core Web API. The derived class implements
25+ /// ApiGatewayProxyFunction is the base class that is implemented in a ASP.NET Core Web API. The derived class implements
2626 /// the Init method similar to Main function in the ASP.NET Core. The function handler for the Lambda function will point
2727 /// to this base class FunctionHandlerAsync method.
2828 /// </summary>
Original file line number Diff line number Diff line change 1+ using Microsoft . AspNetCore . Hosting ;
2+
3+ namespace Amazon . Lambda . AspNetCoreServer
4+ {
5+ /// <summary>
6+ /// ApiGatewayProxyFunction is the base class that is implemented in a ASP.NET Core Web API. The derived class implements
7+ /// the Init method similar to Main function in the ASP.NET Core and provides typed Startup. The function handler for
8+ /// the Lambda function will point to this base class FunctionHandlerAsync method.
9+ /// </summary>
10+ /// <typeparam name ="TStartup">The type containing the startup methods for the application.</typeparam>
11+ public abstract class APIGatewayProxyFunction < TStartup > : APIGatewayProxyFunction where TStartup : class
12+ {
13+ /// <inheritdoc/>
14+ protected override IWebHostBuilder CreateWebHostBuilder ( ) =>
15+ base . CreateWebHostBuilder ( ) . UseStartup < TStartup > ( ) ;
16+ }
17+ }
Original file line number Diff line number Diff line change 55
66namespace TestWebApp
77{
8- public class LambdaFunction : APIGatewayProxyFunction
8+ public class LambdaFunction : APIGatewayProxyFunction < Startup >
99 {
1010 public const string BinaryContentType = "application/octet-stream" ;
1111
1212 protected override void Init ( IWebHostBuilder builder )
1313 {
1414 builder
1515 . UseApiGateway ( )
16- . UseContentRoot ( Directory . GetCurrentDirectory ( ) )
17- . UseStartup < Startup > ( ) ;
16+ . UseContentRoot ( Directory . GetCurrentDirectory ( ) ) ;
1817 }
1918 }
2019}
You can’t perform that action at this time.
0 commit comments