Generating Hypermedia links in a Web API

后端 未结 4 726
星月不相逢
星月不相逢 2021-02-01 19:12

I\'m curious to know how others have dealt with the issue of generating hypermedia links for their web APIs? Specifically, I\'m using ASP.NET Web API, and am torn between having

4条回答
  •  谎友^
    谎友^ (楼主)
    2021-02-01 19:42

    I've added my solution here

    It uses class and property attributes in combination with an ApiController extension method to populate a ResourceLink object in your entity. It can also populate links for any collection properties. It's not the finished article but it is quite intuitive and will make a good start.

提交回复
热议问题