-1

I have created a WebApi Project that serves data to other systems.

At the moment, each system that consumes the API have all the API urls hardcoded and there is a lot of duplicated logic to call and convert data from the API in each system. I am new to webAPI and am struggling to find examples of how I can wrap the calling logic, data conversion and urls into a library that all the systems can share. Can you point me in the right direction?

4

1 回答 1

1

这称为客户端库。

您可以在 API 解决方案内的类库项目中构建所有样板代码,并将其命名为 YourApiClient,然后将编译后的 DLL 分发给您的所有客户端。

唯一需要记住和管理的是每当您更改 API 或客户端库时的分发过程。

于 2013-10-07T03:38:38.227 回答