Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
[Route('/person/{id}')]
public class Person
{
public Int Id;
public string Name;
public Address HomeAddress;
}
[Route('/address/{id}')]
public Address
{
public int Id;
public string City;
}
object Get(int id)
{
var person = LoadPersonWithAddressIdFromDbByPersonId(id);
return person;
}
//Serialized as JSON
{
Id: 5,
Name: Simon,
links: [
{
href: '/address/2',
rel: 'address'
}
]
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.