Created
March 12, 2012 17:35
-
-
Save pedroreys/2023562 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
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