且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

是否创建自托管Web API或使用Asp.Net Core Web API?

更新时间:2021-08-22 23:02:32

出于以下原因,我建议选择选项2,即ASP.NET Core Web API

I recommend option 2 i.e. ASP.NET Core Web API for following reasons

  • 现在ASP.NET Core 2已经发布,它更加专注于更好的性能.您的API构建将是最少的(可以吸收应用程序中使用的内容).
  • 可以以最有效的方式构建
  • 核心Web API. .NET Core代码可以帮助您在非Windows计算机上进行部署.
  • API响应足够快,因为避免了管道中的许多瓶颈.
  • Now that ASP.NET Core 2 is out, it focused more on the better performance. Your API build will be minimal (takes in whats used in the application).
  • Core Web API can be built in most efficient way. The .NET Core code can help you deploy on non-windows machines.
  • API response is fast enough as lots of bottlenecks are avoided in the pipeline.

通过对Kestrel的改进,使用ASP.NET Core 2很有好处.WebAPI可以托管在IIS/Nginx上,也可以很容易地独立存在.

With Kestrel improvements, it beneficial to use ASP.NET Core 2. The Web API can be hosted on IIS/ Nginx or stand alone pretty easily.