Loudeslist เป็นเครื่องมือที่มีประโยชน์ที่ช่วยให้คุณเห็นเส้นทางทั้งหมดในแอปพลิเคชัน. NET ของคุณอย่างชัดเจนและรัดกุม คุณสามารถตรวจสอบวิธีการ URIs คอนโทรลเลอร์การกระทำและมิดเดิลแวร์ของเส้นทางของคุณได้อย่างง่ายดายและปรับแต่งผลลัพธ์ให้เหมาะกับความต้องการของคุณ Loudeslist ทำงานร่วมกับ. NET Core App 3.1, .NET5.0, .NET 6, .NET7.0, หน้ามีดโกน, ASP.NET MVC และโครงการเซิร์ฟเวอร์ Blazor
เข้ากันได้กับ:




จาก nuget.org
Install-Package RoutesList เพียงเพิ่ม services.AddRoutesList ไปยังบริการกำหนดค่าบริการ
ตัวอย่าง:
startup.cs
\ .. .
public void ConfigureServices ( IServiceCollection services )
{
\ .. .
services . AddRoutesList ( ) ;
}และเพิ่มลงในวิธีการกำหนดค่า
ตัวอย่าง:
startup.cs
\ .. .
public void Configure (
IApplicationBuilder app ,
IWebHostEnvironment env ,
)
{
\ .. .
app . UseRoutesList ( ) ;
} จุดสิ้นสุดเริ่มต้น: http://your_application_address/routes
ตัวอย่าง:
program.cs
using RoutesList . Gen ;
var builder = WebApplication . CreateBuilder ( args ) ;
// Add services to the container.
builder . Services . AddRazorPages ( ) ;
builder . Services . AddRoutesList ( ) ; < -- usage
var app = builder . Build ( ) ;
// Configure the HTTP request pipeline.
if ( ! app . Environment . IsDevelopment ( ) ) {
app . UseExceptionHandler ( "/Error" ) ;
// The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
app . UseHsts ( ) ;
}
app . UseHttpsRedirection ( ) ;
app . UseStaticFiles ( ) ;
app . UseRouting ( ) ;
app . UseAuthorization ( ) ;
app . MapRazorPages ( ) ;
app . UseRoutesList ( ) ; < -- usage
app . Run ( ) ;
public partial class Program { } public class Program
{
public static void Main ( string [ ] args )
{
var builder = WebApplication . CreateBuilder ( args ) ;
// Add services to the container.
builder . Services . AddRazorPages ( ) ;
builder . Services . AddServerSideBlazor ( ) ;
builder . Services . AddSingleton < WeatherForecastService > ( ) ;
builder . Services . AddRoutesList ( ) ;
var app = builder . Build ( ) ;
// Configure the HTTP request pipeline.
if ( ! app . Environment . IsDevelopment ( ) ) {
app . UseExceptionHandler ( "/Error" ) ;
// The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
app . UseHsts ( ) ;
}
app . UseHttpsRedirection ( ) ;
app . UseStaticFiles ( ) ;
app . UseRouting ( ) ;
app . MapBlazorHub ( ) ;
app . MapFallbackToPage ( "/_Host" ) ;
app . UseRoutesList ( options => {
options . SetAppAssembly ( typeof ( Program ) . Assembly ) ; < -- setup current application webassembly with blazor component
} ) ;
app . Run ( ) ;
}
} ใน app.userouteslist คุณสามารถผ่านตัวเลือกได้
| ชื่อ | คำอธิบาย |
|---|---|
| จุดสิ้นสุด | ชื่อจุดสิ้นสุด |
| ชื่อ | ชื่อเรื่องสำหรับเว็บไซต์ |
| SettableClasses | เพิ่มคลาสเทมเพลตสำหรับตาราง |
| setAppassembly | ตั้งแอปพลิเคชันแอปพลิเคชันปัจจุบันพร้อมกับส่วนประกอบ Blazor |
startup.cs
public void Configure (
IApplicationBuilder app ,
IWebHostEnvironment env ,
)
{
IDictionary < string , string [ ] > dict = new Dictionary < string , string [ ] > ( ) ;
string [ ] classes = dict [ "table" ] = new string [ 2 ] { "table" , "table-striped" } ;
app . UseRoutesList ( options => {
options . Endpoint = "your_new_endpoints" ;
options . Tittle = "Your new Title for site" ;
options . SetTableClasses ( classes ) ;
options . SetAppAssembly ( typeof ( Program ) . Assembly )
} ) ;
}program.cs
var builder = WebApplication . CreateBuilder ( args ) ;
// Add services to the container.
builder . Services . AddRazorPages ( ) ;
builder . Services . AddControllersWithViews ( ) ;
var app = builder . Build ( ) ;
// Configure the HTTP request pipeline.
if ( ! app . Environment . IsDevelopment ( ) )
{
app . UseExceptionHandler ( "/Error" ) ;
app . UseHsts ( ) ;
}
app . UseHttpsRedirection ( ) ;
app . UseStaticFiles ( ) ;
app . UseAuthorization ( ) ;
app . MapGet ( "/hi" , ( ) => "Hello!" ) ;
app . MapDefaultControllerRoute ( ) ;
app . MapRazorPages ( ) ;
app . UseRoutesList ( options => {
options . Endpoint = "your_new_endpoints" ;
options . Tittle = "Your new Title for site" ;
options . SetTableClasses ( classes ) ;
options . SetAppAssembly ( typeof ( Program ) . Assembly )
} ) ;
app . Run ( ) ; ยินดีต้อนรับการมีส่วนร่วมเสมอไม่ว่าจะเป็นการเพิ่ม/แนะนำคุณสมบัติใหม่การแก้ไขข้อบกพร่องการจัดทำเอกสารรูปแบบไฟล์ใหม่หรือเพียงแค่แก้ไขไวยากรณ์บางส่วน สำหรับสิ่งนี้สร้างปัญหา GitHub ใหม่และอธิบายปัญหาของคุณและเพิ่มแท็กปัญหาสำหรับข้อผิดพลาด/การปรับปรุง