/
PersonController.cs
45 lines (43 loc) · 1.25 KB
/
PersonController.cs
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
using System;
using System.Collections.Generic;
using System.Web.Http;
using TypeScriptSample.Models;
namespace TypeScriptSample.Web.Controllers
{
public class PersonController : ApiController
{
public IEnumerable<Person> Get()
{
return new[]
{
new Person
{
DateOfBirth = new DateTime(1980, 01, 01),
Name = "Simon",
MaritalStatus = MaritalStatus.Married,
},
new Person
{
DateOfBirth = new DateTime(1988, 01, 01),
Name = "Lucy",
MaritalStatus = MaritalStatus.Married,
},
new Person
{
DateOfBirth = new DateTime(1981, 01, 01),
Name = "Dave",
MaritalStatus = MaritalStatus.Single,
},
new Person
{
DateOfBirth = new DateTime(1977, 01, 01),
Name = "Jane",
MaritalStatus = MaritalStatus.Divorced,
}
};
}
public void Post([FromBody]Person person)
{
}
}
}