Sign In| Join
Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Member
486 Points
78 Posts
Microsoft
Apr 03, 2012 04:24 PM|LINK
You're right, if the Contact object in the message body contains an ID, that will be used for the id parameter.
You can force Web API to use the URI by adding the [FromUri] attribute to the parameter:
public void PutContact([FromUri]int id, Contact contact)
MikeWasson
Member
486 Points
78 Posts
Microsoft
Re: PUT handler parameter not getting set from URI
Apr 03, 2012 04:24 PM|LINK
You're right, if the Contact object in the message body contains an ID, that will be used for the id parameter.
You can force Web API to use the URI by adding the [FromUri] attribute to the parameter: