Asp.net core mvc 如何在.net core中设置mvcopions.enableendpointrouting

Asp.net core mvc 如何在.net core中设置mvcopions.enableendpointrouting,asp.net-core-mvc,Asp.net Core Mvc,我已经添加了我已经厌倦的内容,我正在尝试在ConfigureServices方法中设置mvcopions.enableendpointrouting public void ConfigureServices(IServiceCollection services) { services.AddMvc(); } // This method gets called by the runtime. Use this m

我已经添加了我已经厌倦的内容,我正在尝试在ConfigureServices方法中设置mvcopions.enableendpointrouting

  public void ConfigureServices(IServiceCollection services)
        {
            services.AddMvc();

        }

        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
        {
            if (env.IsDevelopment())
            {
                DeveloperExceptionPageOptions developerExceptionPageOptions = new DeveloperExceptionPageOptions()
                {
                    SourceCodeLineCount = 1
                };
                app.UseDeveloperExceptionPage(developerExceptionPageOptions);
            }

            app.UseStaticFiles();
            app.UseMvcWithDefaultRoute();

欢迎来到这个网站。可以通过以下方式启用/禁用端点路由:

public void ConfigureServices(IServiceCollection services)
        {
            services.AddMvc(x => x.EnableEndpointRouting = false);
           ...
        }