其他分享
首页 > 其他分享> > 基于.NET6平台开发WebApi(三)

基于.NET6平台开发WebApi(三)

作者:互联网

本项目使用的一些功能框架如下:

Swagger,Serilog,Sqlugar,CSRedis,Autofac

具体配置将会在后续逐一介绍

1、我们先创建一个BaseController,用于实现一些通用的功能。

2、修改BaseController继承于ControllerBase,删掉其中的Index方法,为BaseController添加类注释,并添加[Authorize]和[ApiController]标记。

3、打开Nuget,搜索安装Swashbuckle.AspNetCore。

 

标签:WebApi,Index,基于,BaseController,CSRedis,添加,NET6,Swagger
来源: https://www.cnblogs.com/netsix/p/15762614.html