|
|
@ -34,6 +34,7 @@ namespace AccessStudy.WebApi
|
|
|
|
//services.AddScoped<IStudentIDal,StudentOdbcDal>();
|
|
|
|
//services.AddScoped<IStudentIDal,StudentOdbcDal>();
|
|
|
|
services.AddScoped<IStudentIDal,StudentOledbDal>();
|
|
|
|
services.AddScoped<IStudentIDal,StudentOledbDal>();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#region Swagger
|
|
|
|
services.AddSwaggerGen(option =>
|
|
|
|
services.AddSwaggerGen(option =>
|
|
|
|
{
|
|
|
|
{
|
|
|
|
option.SwaggerDoc("v1", new Microsoft.OpenApi.Models.OpenApiInfo() { Title = "API", Version = "v1" });
|
|
|
|
option.SwaggerDoc("v1", new Microsoft.OpenApi.Models.OpenApiInfo() { Title = "API", Version = "v1" });
|
|
|
@ -41,13 +42,21 @@ namespace AccessStudy.WebApi
|
|
|
|
// Set the comments path for the Swagger JSON and UI.
|
|
|
|
// Set the comments path for the Swagger JSON and UI.
|
|
|
|
var xmlFile = $"{Assembly.GetExecutingAssembly().GetName().Name}.xml";
|
|
|
|
var xmlFile = $"{Assembly.GetExecutingAssembly().GetName().Name}.xml";
|
|
|
|
var xmlPath = System.IO.Path.Combine(AppContext.BaseDirectory, xmlFile);
|
|
|
|
var xmlPath = System.IO.Path.Combine(AppContext.BaseDirectory, xmlFile);
|
|
|
|
option.IncludeXmlComments(xmlPath);
|
|
|
|
|
|
|
|
|
|
|
|
//不显示控制器注释
|
|
|
|
|
|
|
|
//option.IncludeXmlComments(xmlPath);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//显示控制器注释
|
|
|
|
|
|
|
|
option.IncludeXmlComments(xmlPath, true);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
//services.ConfigureSwaggerGen(option =>
|
|
|
|
//services.ConfigureSwaggerGen(option =>
|
|
|
|
//{
|
|
|
|
//{
|
|
|
|
|
|
|
|
|
|
|
|
//});
|
|
|
|
//});
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
|
|
|
|
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
|
|
|
|