refactor: return the modified interfaces for further modification

This commit is contained in:
2024-10-25 02:22:42 +03:00
parent 4970dd782a
commit 428c2dc3ba
4 changed files with 10 additions and 19 deletions

View File

@ -51,15 +51,13 @@ public static class SwaggerConfiguration
options.IncludeXmlComments(Path.Combine(basePath, "ApiDtoDocs.xml"));
});
services.AddTransient<IConfigureOptions<SwaggerGenOptions>, ConfigureSwaggerOptions>();
return services;
return services.AddTransient<IConfigureOptions<SwaggerGenOptions>, ConfigureSwaggerOptions>();
}
public static IApplicationBuilder UseCustomSwagger(this IApplicationBuilder app, IServiceProvider services)
{
app.UseSwagger();
app.UseSwaggerUI(options =>
return app.UseSwaggerUI(options =>
{
options.InjectStylesheet($"{UrlHelper.GetSubPath}css/swagger/SwaggerDark.css");
var provider = services.GetService<IApiVersionDescriptionProvider>();
@ -72,7 +70,5 @@ public static class SwaggerConfiguration
options.RoutePrefix = UrlHelper.GetSubPathSwagger.Trim('/');
}
});
return app;
}
}