using System.Web.Mvc; using System.Web.Routing; RouteCollection routes = new RouteCollection(); routes.Add("Default", new Route("{controller}/{action}/{id}", new MvcRouteHandler()));
using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Routing; IEndpointRouteBuilder endpoints = builder.ConfigureEndpoints(); endpoints.MapControllerRoute(name: "default", pattern: "{controller=Home}/{action=Index}/{id?}");This example adds a route to the endpoint route builder with the name "default" and a pattern that matches the default MVC URL structure. It also specifies default values for the controller, action, and optional id parameter. Library: Microsoft.AspNetCore.Mvc Overall, the package library for the RouteCollection Add method will depend on the specific framework or platform being used for the C# application. It could be System.Web, Microsoft.AspNetCore.Mvc, or something else entirely.