[英]How to do you make both a Razor Page and C# code framework with ASP.NET Core?
I have written a rather simple ASP.NET Core web app, which I would like to use as a framework for my future web apps.我编写了一个相当简单的 ASP.NET Core web 应用程序,我想将其用作我未来 web 应用程序的框架。
How can I get both functionalities in one single NuGet package - that is the C# and the razor pages templates for future projects? How can I get both functionalities in one single NuGet package - that is the C# and the razor pages templates for future projects?
How do I make this kind of template?如何制作这种模板? I can't seem to find any tutorials for the whole package.
我似乎找不到整个 package 的任何教程。
How do I specify a settings or similar logic for fitting in some variables like the general page name?如何指定设置或类似的逻辑以适应一些变量,如通用页面名称?
How do I specify a settings or similar logic for fitting in some variables like the general page name?
如何指定设置或类似的逻辑以适应一些变量,如通用页面名称?
As far as I know, we could modify the asp.net core routes to modify the each routes.据我所知,我们可以修改 asp.net 核心路由来修改每个路由。
For example, the controller is homecontroller and then you use set the attribute route to modify it like "test" like this ``.例如,controller 是 homecontroller 然后你使用设置属性路由来修改它像“测试”这样``。
If you want to make this web application's pages has a specific pre-fix, you could set it as Area.如果您想让这个 web 应用程序的页面具有特定的前缀,您可以将其设置为区域。
[Route("Blog/{action}")]
public class HomeController : Controller
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.