Hyprlinkrを使用してHTTPPostアクションへのURLを生成しようとしています。私のコントローラーは次のようになります。
public class MyController : ApiController {
[HttpPost]
public void DoSomething([FromBody]SomeDto someDto) {
...
}
}
このルートで:
routes.MapHttpRoute(
name: "MyRoute",
routeTemplate: "dosomething",
defaults: new { controller = "My", action = "DoSomething" });
http://example.com/dosomethingという単純なURLを取得することを期待していますが、機能しません。私は2つの方法を試しました:
1)routeLinker.GetUri(c => c.DoSomething(null))
-スローNullReferenceException
2)routeLinker.GetUri(c => c.DoSomething(new SomeDto()))
-無効なURLを生成します:
http ://example.com/dosomething?someDto = Namespace.SomeDto
更新: githubで開かれた問題: https ://github.com/ploeh/Hyprlinkr/issues/17