diff --git a/Lambdas/GetCharityTypes/Function.cs b/Lambdas/GetCharityTypes/Function.cs index b2226ad..118b41b 100644 --- a/Lambdas/GetCharityTypes/Function.cs +++ b/Lambdas/GetCharityTypes/Function.cs @@ -5,7 +5,6 @@ using Amazon.RDS.Util; using Amazon; using System.Text.Json; -using System.Text.Json.Serialization.Metadata; using System.Text.Json.Serialization; using Amazon.Lambda.APIGatewayEvents; @@ -34,13 +33,17 @@ private static async Task Main(string[] args) _connectionString = $"Server={_dbHost};Port={_dbPort};Database={_dbName};" + $"User={_dbUser};Password={authToken};SSL Mode=Required;"; - Func> handler = FunctionHandler; - // Use the source generator serializer + Func> handler = async (context) => + { + return await FunctionHandler(context); + }; + await LambdaBootstrapBuilder.Create( handler, new SourceGeneratorLambdaJsonSerializer() ).Build().RunAsync(); + } public static async Task FunctionHandler(ILambdaContext context) @@ -86,12 +89,6 @@ public partial class CustomSerializer : JsonSerializerContext { } -//[JsonSerializable(typeof(List))] -//[JsonSourceGenerationOptions(PropertyNamingPolicy = JsonKnownNamingPolicy.CamelCase)] -//public partial class CustomSerializerContext : JsonSerializerContext -//{ -//} - public class CharityType { public int Id { get; set; }