ここで何が問題なのかわかりません。一番上に特定のルートがありますが、エラー 404 が返されるだけです - 見つかりません。
/api/playernames/competitionsは機能しますが、 /api/playernames/teams/competitionid/ 81bbd23d -54a2-4204-a771-85c48555a992は機能しません。私は何を間違っていますか?
routes.MapRoute("PlayerNamesDbTeams", "playernames/teams/competitionid/{competitionId}",
new { controller = "playernames", action = "Teams", competitionId = "" });
routes.MapRoute("default", "{controller}/{action}/{id}",
new { controller = "playernames", action = "Competitions" });
public class PlayerNamesController : ApiController
{
[HttpGet]
public List<Competition> Competitions()
{
using (var service = new AggregatorClient())
{
return service.GetCompetitions();
}
}
[HttpGet]
public List<Team> Teams(string competitionId)
{
using (var service = new AggregatorClient())
{
return service.GetTeams(competitionId);
}
}
}
/api/playernames/teams?competitionId=xxxxxxのようなリクエストを行うと機能します。