I have a C# lambda function that is called from API gateway using a GET request.
[LambdaSerializer(typeof(Amazon.Lambda.Serialization.Json.JsonSerializer))]
public ResponseModel MyFunction(RequestModel request)
{
return new ResponseModel { body = "Hello world!" };
}
public class RequestModel
{
[JsonProperty("a")]
public string A { get; set; }
[JsonProperty("b")]
public string B { get; set; }
}
public class ResponseModel
{
public int statusCode { get; set; } = 200;
public object headers { get; set; } = new object();
public string body { get; set; } = "";
}
How do I map the query string parameters sent to API gateway to the RequestModel parameter in MyFunction?
I have called the function with parameters but they don't seem to come through. Is there a wait to achieve this with a C# lambda function?
Thanks,
Chris