locked
Scaffolding custom views RRS feed

  • Question

  • User-183185495 posted



    Is there any documentation or tutorials on scaffolding it 
    Asp.net core. I want to add some custom code to views that am always repeating. I would like to be able to modify the controller dialog that appears to add two tick boxes there as well to allow for the new custom generators.


    I know Microsoft done away with the super simple t4 generators for the new scaffolding GitHub project but the documentation in its use is very poor.

    Thursday, July 16, 2020 5:27 PM

Answers

  • User-821857111 posted

    The templates are located at C:\Users\{username}\.nuget\packages\microsoft.visualstudio.web.codegenerators.mvc\{Core Version}\Templates\.

    You can edit them. I'm not sure about adding new ones. 

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, July 17, 2020 5:46 AM
  • User711641945 posted

    Hi roguenidb,

    As Mike said, you could find the default template in `C:\Users\{username}\.nuget\packages\microsoft.visualstudio.web.codegenerators.mvc\{Core Version}\Templates\`.

    You could copy the Templates folder to your project and edit them as required.Then you could did the scaffold operation.

    Here is what I try with an asp.net core mvc application.Because I do not use Identity,so I just copy the Templates folder to project with out Identity and Identity_Versioned folder:

    Best Regards,

    Rena

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, July 17, 2020 6:31 AM

All replies

  • User-821857111 posted

    The templates are located at C:\Users\{username}\.nuget\packages\microsoft.visualstudio.web.codegenerators.mvc\{Core Version}\Templates\.

    You can edit them. I'm not sure about adding new ones. 

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, July 17, 2020 5:46 AM
  • User711641945 posted

    Hi roguenidb,

    As Mike said, you could find the default template in `C:\Users\{username}\.nuget\packages\microsoft.visualstudio.web.codegenerators.mvc\{Core Version}\Templates\`.

    You could copy the Templates folder to your project and edit them as required.Then you could did the scaffold operation.

    Here is what I try with an asp.net core mvc application.Because I do not use Identity,so I just copy the Templates folder to project with out Identity and Identity_Versioned folder:

    Best Regards,

    Rena

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, July 17, 2020 6:31 AM