Working with Parameter Serializers
Understand the role of JSON serializers in AWS Lambda functions using C#. Learn how to implement the Amazon.Lambda.Serialization.SystemTextJson package to automatically convert data between JSON strings and C# objects. This lesson helps you improve your function handlers by using serializable input and output classes, making code easier to write and maintain.
We'll cover the following...
How and why to use a serializer
We want to use a JSON serializer inside our .NET AWS Lambda project because it makes the development experience a lot more convenient. With a serializer, we can use any JSON-serializable data type as an input and output in our function handler. These include primitive data types, such as string and int, and Plain Old CLR Object (POCO) classes and records that are used purely for storing data.
Without a serializer, both the input and output of a function handler method have to be Stream. We’d have to extract data from the stream, do something with it, and place the response on another stream. This is much more difficult to implement and makes the code far less ...