添加swagger备注

发布时间 2023-10-23 11:21:42作者: 想睡觉的小坤

先在api右键属性

 

在Program里面:

builder.Services.AddSwaggerGen(a =>
{
string path = AppDomain.CurrentDomain.BaseDirectory + "Demo.WebApi.xml";
a.IncludeXmlComments(path, true);
});