aspnet Web APIを使用した属性ルーティングは初めてです。
public class UsersController : ApiController
{
[GET("users/me/brands/{id}")]
public IEnumerable<Brand> GetBrands(long id)
{
return _repository.FindByUser(id);
}
}
しかし、私はこのアクションに到達できませんでした。私は非常に多くの方法を試しました:
http://example.com/api/users/brands/4
http://example.com/api/users/brands?id=4
http://example.com/users/brands?id=4
http://example.com/users/brands/4
PS:私もマッピングしました[GET("api/users/me/brands/{id}")]
私は何が欠けていますか?