Skip to content

Commit eec9ca7

Browse files
committed
Updated the sample to use an object
1 parent 8e016fe commit eec9ca7

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

Source/Samples/SampleMvc/Controllers/ValuesController.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public string Get(int id) {
2020
}
2121

2222
// POST api/values
23-
public void Post([FromBody] string value) {
23+
public void Post([FromBody] Person person) {
2424
throw new ApplicationException("WebApi POST error");
2525
}
2626

@@ -30,4 +30,8 @@ public void Put(int id, [FromBody] string value) {}
3030
// DELETE api/values/5
3131
public void Delete(int id) {}
3232
}
33+
34+
public class Person {
35+
public string Name { get; set; }
36+
}
3337
}

0 commit comments

Comments
 (0)