Why can't we add a Web API as a “service reference” in Visual Studio the same way we can with WCF or ASMX?

前端 未结 4 1913
忘掉有多难
忘掉有多难 2020-12-14 15:41

I\'ve decided to use Web API (as a middle tier) for an app I\'m developing, but can\'t seem to figure out how to \"tie it in\" to the front end (front end being an ASP.NET M

4条回答
  •  无人及你
    2020-12-14 16:18

    Do you mean a Rest Web Service? With Rest, there is no service definition page, like with WCF or ASMX. Usually people want to use a Rest API with JSON.. however.. if you are just looking for a JSON output, and you want your clients to quickly be able to connect to your service, you should consider OData. It's really easy to create and it makes your data layer accessible for a large number of client languages. They have the OData client library ported for a ton of languages. Submitted as an answer, as requested. : )

提交回复
热议问题