Skip to content

Commit

Permalink
try another way
Browse files Browse the repository at this point in the history
  • Loading branch information
RobKraft committed Dec 9, 2024
1 parent d7e03af commit 2365ff0
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions Lambdas/GetCharityTypes/Function.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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<ILambdaContext, Task<string>> handler = FunctionHandler;

// Use the source generator serializer
Func<ILambdaContext, Task<string>> handler = async (context) =>
{
return await FunctionHandler(context);
};

await LambdaBootstrapBuilder.Create(
handler,
new SourceGeneratorLambdaJsonSerializer<CustomSerializer>()
).Build().RunAsync();

}

public static async Task<string> FunctionHandler(ILambdaContext context)
Expand Down Expand Up @@ -86,12 +89,6 @@ public partial class CustomSerializer : JsonSerializerContext
{
}

//[JsonSerializable(typeof(List<CharityType>))]
//[JsonSourceGenerationOptions(PropertyNamingPolicy = JsonKnownNamingPolicy.CamelCase)]
//public partial class CustomSerializerContext : JsonSerializerContext
//{
//}

public class CharityType
{
public int Id { get; set; }
Expand Down

0 comments on commit 2365ff0

Please sign in to comment.