Created
March 19, 2013 20:20
-
-
Save ssboisen/5199725 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[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