I'm not sure if you read my last post. I think the problem is you do not understand REST (Web API) fundamentals.
If you are using the default Web API template in Visual Studio then "getallgames" in the URL below is a route parameter NOT an action name.
http://dataconnective.com/api/games/getallgames
Web API does not use action names in the URL. Take a look at the App_Start\WebApiConfig.cs.
config.Routes.MapHttpRoute(
name: "DefaultApi",
routeTemplate: "api/{controller}/{id}",
defaults: new { id = RouteParameter.Optional }
As you can see there's no action in the route template.
To prove this fact let's look at your sample application. You can enter either of the two URLs below yet the same result is returned.
http://dataconnective.com/api/games/getallgames
http://dataconnective.com/api/games/blah
The reason your break point is not hit is because the getallgames action is NOT being hit. The action that is invoked is the one with a route parameter.
Look at the following example.
public class GameController : ApiController
{
public IHttpActionResult GetAllGames()
{
Game game = new Game();
List<Game> Games = game.ListGames();
return Ok(Games);
}
public IHttpActionResult Getbyid(string id)
{
return Ok(id);
}
}
If I enter https://localhost:44310/api/game/getallgames in the browser, the result is "getallgames" which is the "id" route parameter found in the Getbyid(string id) action.
<string xmlns="http://schemas.microsoft.com/2003/10/Serialization/">getallgames</string>
The Getbyid(string id) is invoked not GetAllGames(). This is a fundamental building block in REST and this type of information is openly covered in every Web API getting started tutorial.
FYI, when I enter http://dataconnective.com/api/games in the browser's address bar, your API returns an 500 Internal Server Error.
<Error>
<Message>An error has occurred.</Message>
</Error>