【问题标题】:showing class summary beside category in asp.net core api在 asp.net core api 中的类别旁边显示类摘要
【发布时间】:2020-03-02 21:08:55
【问题描述】:

我正在用 ASP.NET Core 开发 Web API。 我正在寻找一种在 asp.net core 中在类别旁边显示类摘要的方法

【问题讨论】:

    标签: swagger asp.net-core-webapi


    【解决方案1】:

    使用这个

            services.AddSwaggerGen(c =>
            {
                var xmlFile = $"{Assembly.GetExecutingAssembly().GetName().Name}.xml";
                var xmlPath = Path.Combine(AppContext.BaseDirectory, xmlFile);
                c.IncludeXmlComments(xmlPath, includeControllerXmlComments: true);
            });
    

    【讨论】:

    • 我用过 c.IncludeXmlComments(xmlPath) 但没用
    • IncludeControllerXmlComments 参数解决你的问题
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-02-13
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多