ASP.NET Core Web API官方文档(链接)

下面这篇微软官方文档,介绍了构建ASP.NET Core Web API的一些细节:

Create web APIs with ASP.NET Core

其中这里有提到一个特性类ApiControllerAttribute,实际上这个特性类在ASP.NET Core Web API的Controller上并不是必须的,但是使用它之后可以带来很多好处,使得开发人员获得更好的体验。对于ApiControllerAttribute特性类的使用,还可以查看:讲一下Asp.net core MVC2.1 里面的 ApiControllerAttribute

关于在ASP.NET Core Web API中,Controller的Action方法能返回的类型,可以查看这篇微软官方文档:

Controller action return types in ASP.NET Core web API

可以通过这篇文章了解,如何在ASP.NET Core Web API中,格式化Controller的Action方法的返回数据:
Format response data in ASP.NET Core Web API

可以参考这篇文章了解,为ASP.NET Core Web API启用Swagger / OpenAPI:

ASP.NET Core web API help pages with Swagger / OpenAPI

如何在ASP.NET Core中通过Swashbuckle来启用Swagger,可以参考:

Get started with Swashbuckle and ASP.NET Core