摘要: 创建新项目,选择创建 webapi项目 1. 创建完成后点击 Controllers 文件夹,单机右键,选择添加控制器 2.点击确定3.选择api控制器 4.点击确定 5. 更具自己需求,修改 [Route("api/[controller]")], 我这点改为 [Route("api/[contr 阅读全文
posted @ 2024-05-24 14:55 龙卷风吹毁停车场 阅读(190) 评论(0) 推荐(0)
摘要: 我在appsettings.json中配置了链接数据库的信息,红色标记区域 { "ConnectionStrings": { "connStr": "server=.;database=PerformanceAppraisalDb;uid=sa;pwd=123456" }, "Logging": { 阅读全文
posted @ 2024-05-24 13:56 龙卷风吹毁停车场 阅读(133) 评论(0) 推荐(0)
摘要: 1. 再Program.cs 文件中添加 using WebApplication1.Webapi.Utility.ApiVersions; var builder = WebApplication.CreateBuilder(args); // Add services to the contai 阅读全文
posted @ 2024-05-24 11:54 龙卷风吹毁停车场 阅读(65) 评论(0) 推荐(0)