Last active
July 23, 2017 12:24
-
-
Save justinyoo/c1aecd1bed6d24459c8909342febce8a to your computer and use it in GitHub Desktop.
Testing Serverless Applications - Part 2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Returns OK (200) response | |
public static async Task<HttpResponseMessage> Run(HttpRequestMessage req, ILogger log) | |
{ | |
var settings = new JsonSerializerSettings() | |
{ | |
ContractResolver = new CamelCasePropertyNamesContractResolver(), | |
NullValueHandling = NullValueHandling.Ignore, | |
MissingMemberHandling = MissingMemberHandling.Ignore | |
}; | |
var formatter = new JsonMediaTypeFormatter() { SerializerSettings = settings }; | |
var models = new List<ContentModel>() | |
{ | |
new ContentModel() { Name = "abc", Url = "https://templates.io/abc" }, | |
new ContentModel() { Name = "xya", Url = "https://templates.io/xyz" } | |
}; | |
return req.CreateResponse(HttpStatusCode.OK, models, formatter); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment