-
Notifications
You must be signed in to change notification settings - Fork 494
Expand file tree
/
Copy pathBedrockAgentApiFunction{TStartup}.cs
More file actions
41 lines (34 loc) · 1.5 KB
/
BedrockAgentApiFunction{TStartup}.cs
File metadata and controls
41 lines (34 loc) · 1.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
using Microsoft.AspNetCore.Hosting;
using System.Diagnostics.CodeAnalysis;
namespace Amazon.Lambda.AspNetCoreServer
{
/// <summary>
/// BedrockAgentApiFunction is the base class that is implemented in a ASP.NET Core Web API. The derived class implements
/// the Init method similar to Main function in the ASP.NET Core and provides typed Startup. The function handler for
/// the Lambda function will point to this base class FunctionHandlerAsync method.
/// </summary>
/// <typeparam name ="TStartup">The type containing the startup methods for the application.</typeparam>
public abstract class BedrockAgentApiFunction<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicMethods | DynamicallyAccessedMemberTypes.PublicConstructors)] TStartup> : BedrockAgentApiFunction where TStartup : class
{
/// <summary>
/// Default Constructor. The ASP.NET Core Framework will be initialized as part of the construction.
/// </summary>
protected BedrockAgentApiFunction()
: base()
{
}
/// <summary>
///
/// </summary>
/// <param name="startupMode">Configure when the ASP.NET Core framework will be initialized</param>
protected BedrockAgentApiFunction(StartupMode startupMode)
: base(startupMode)
{
}
/// <inheritdoc/>
protected override void Init(IWebHostBuilder builder)
{
builder.UseStartup<TStartup>();
}
}
}