I'm new to MVC Web Api.
I want to have two different methods.
PUT localhost/api/user
- to modify a user
POST localhost/api/user
- to add a user
So my ApiController
looks like this:
[HttpPost]
public bool user(userDTO postdata)
{
return dal.addUser(postdata);
}
[HttpPut]
public bool user(userDTO postdata)
{
return dal.editUser(postdata);
}
However my HttpPut
method says "already defines a member called user with the same parameter types.
Shouldn't the [HttpPost]
and [HttpPut]
make the methods unique?