CodePaste Logo
New Snippet New Snippet Recent Snippets Recent Snippets My Snippets My Snippets Web Code Search Snippets Search
Sign inor Register
Language: C#

UriBinding

164 Views
Copy Code Show/Hide Line Numbers
//in startup
UriBinder.AddUriBinding<Contact>("contact", "contact/(.+)", 
    cid => ContactsHandler._contacts.Single(c => c.ContactID == cid));
 
//request is http://contactmanager/contact/1 
 
//the resource takes contact as a param
public class ContactHandler {
    public Contact Get(Contact contact)
    {
        return contact;
    }
}
by Glenn Block
  September 01, 2010 @ 1:06am

Add a comment


Report Abuse
brought to you by:
West Wind Techologies



If you find this site useful and use it frequently please consider making a donation to support this free service.
Donate