Skip to content

Instantly share code, notes, and snippets.

@ssboisen
Created March 19, 2013 20:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ssboisen/5199725 to your computer and use it in GitHub Desktop.
Save ssboisen/5199725 to your computer and use it in GitHub Desktop.
[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