add notice regarding undocumented methods notices and updated code (#5089)
* add notice regarding undocumented methods notices and updated code for pointing to the xml file * Update web-api-help-pages-using-swagger.md * cleanup using in startup.cs and updated notice message regarding missing xml comment * add missing startup.cs changes * Minor editpull/5136/head
parent
ccbded790f
commit
ae5d14d6a0
|
@ -223,6 +223,8 @@ See Visual Studio Code.
|
|||
|
||||
---
|
||||
|
||||
Enabling XML comments provides debug information for undocumented public types and members. Undocumented types and members are indicated by the warning message: *Missing XML comment for publicly visible type or member*.
|
||||
|
||||
Configure Swagger to use the generated XML file. For Linux or non-Windows operating systems, file names and paths can be case sensitive. For example, a *ToDoApi.XML* file would be found on Windows but not CentOS.
|
||||
|
||||
[!code-csharp[Main](../tutorials/web-api-help-pages-using-swagger/sample/TodoApi/Startup.cs?name=snippet_ConfigureServices&highlight=20-22)]
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
using System.IO;
|
||||
using System;
|
||||
using System.IO;
|
||||
using Microsoft.AspNetCore.Builder;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
|
@ -9,7 +10,7 @@ using TodoApi.Models;
|
|||
namespace TodoApi
|
||||
{
|
||||
public class Startup
|
||||
{
|
||||
{
|
||||
#region snippet_ConfigureServices
|
||||
public void ConfigureServices(IServiceCollection services)
|
||||
{
|
||||
|
@ -30,9 +31,9 @@ namespace TodoApi
|
|||
});
|
||||
|
||||
// Set the comments path for the Swagger JSON and UI.
|
||||
var basePath = PlatformServices.Default.Application.ApplicationBasePath;
|
||||
var basePath = AppContext.BaseDirectory;
|
||||
var xmlPath = Path.Combine(basePath, "TodoApi.xml");
|
||||
c.IncludeXmlComments(xmlPath);
|
||||
c.IncludeXmlComments(xmlPath);
|
||||
});
|
||||
}
|
||||
#endregion
|
||||
|
|
Loading…
Reference in New Issue