asp.net core-7.在Core Mvc中使用Options

1,添加asp.net core mvc应用程序

2,添加Controllers控制器文件夹,Views视图文件夹

然后在Startup类中ConfigureServices方法中注册一下services.Configure<Class>(Configuration);和 services.AddMvc(); ,Configure方法中配置默认路由app.UseMvcWithDefaultRoute();

3,在index页面中

 最后按 f5

原文地址:https://www.cnblogs.com/MingQiu/p/8157533.html