WebAPI Controller GetAll or Get some Id

Viewed 13322

I have a controller like this

[Route("api/Foo/MyController/{id}")]
public IHttpActionResult Get(int id)
{
   //Code code
   foo(id); // Foo accept Int or Null
}

This do work, if call api/Foo/MyController/1, but i needed call api/Foo/MyController like it "GetAll" the parameter id now is null and the stuff into controller return all, how go there?

3 Answers
Related