简体   繁体   中英

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.

  • 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.

  • 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.

For example, the controller is homecontroller and then you use set the attribute route to modify it like "test" like this ``.

If you want to make this web application's pages has a specific pre-fix, you could set it as Area.

[Route("Blog/{action}")]
public class HomeController : Controller

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM