With respect to REST and ASP.NET Web API, is it necessary to add the identifier to the route for a PUT action method even when the DTO payload (e.g., JSON) itself specifies the identifier?
For example:
public void Put(int id, [FromBody]SomeDto someDto) // someDto has an 'Id' property
The ASP.NET Web API template includes the id
parameter and I have seen many examples of this.
In contrast, is it OK to omit the id
parameter and still adhere to REST guidelines? For example:
public void Put([FromBody]SomeDto someDto)