Skip to content

Instantly share code, notes, and snippets.

@pedroreys
Created March 12, 2012 17:35
Show Gist options
  • Save pedroreys/2023562 to your computer and use it in GitHub Desktop.
Save pedroreys/2023562 to your computer and use it in GitHub Desktop.
public class Contact : IApiResource
{
public int Id { get; set; }
// ... other Contact Members
public SetLocation(ResourceLocation location)
{
location.Location = new Uri("http://api.contoso.com/contacts/"+Id);
}
}
public class ContactsController : ApiController
{
public HttpResponseMessage Post(Contact contact)
{
//create new contact resource
return new CreateResponse(contact);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment