- Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathAzureFunctionWithClasses.cs
More file actions
Latest commit
27 lines (22 loc) · 775 Bytes
/
Copy pathAzureFunctionWithClasses.cs
File metadata and controls
27 lines (22 loc) · 775 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#r "Newtonsoft.Json"
usingSystem.Net;
usingMicrosoft.AspNetCore.Mvc;
usingMicrosoft.Extensions.Primitives;
usingNewtonsoft.Json;
publicstaticasyncTask<IActionResult>Run(HttpRequestreq,ILoggerlog)
{
log.LogInformation("C# HTTP trigger function processed a request.");
stringrequestBody=awaitnewStreamReader(req.Body).ReadToEndAsync();
Websiteobj;
obj=JsonConvert.DeserializeObject<Website>(requestBody);
log.LogInformation((obj.id).ToString());
log.LogInformation(obj.name);
log.LogInformation((obj.url).ToString());
return(ActionResult)newOkObjectResult(obj);
}
publicclassWebsite
{
publicintid{get;set;}
publicstringname{get;set;}
publicstringurl{get;set;}
}