0

How can I add and create new razor pages and folders via code using Asp.NET Core?

1
  • 2
    I am not sure why you want to, but perhaps what you are trying to accomplish can be done more easily than this. What is the end goal for doing this? Commented Oct 11, 2021 at 22:05

1 Answer 1

1

According to your needs, I think you want a hint similar to the code generator.

You can use T4 Text Templates for code generation.

I suggest you read the code of Generator-ASP.NET-Core-MVC, it should help you.

Example link and picture

ManageChangePassword.tt

enter image description here

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.