Custom scaffold templates in ASP.NET Core

前端 未结 4 1749
半阙折子戏
半阙折子戏 2020-12-01 01:38

Now that I figured out how to enable scaffolding in ASP.NET Core MVC (see View scaffold templates in ASP.NET Core), I\'d like to create custom template files for Views. I f

相关标签:
4条回答
  • 2020-12-01 02:14

    Latest version as of Oct 2018 could be found in GitHub of the Asp.NET https://github.com/aspnet/Scaffolding/tree/master/src/VS.Web.CG.Mvc/Templates

    0 讨论(0)
  • 2020-12-01 02:21

    I am using Microsoft.VisualStudio.Web.CodeGeneration.Tools 1.0.0-preview2-final

    Templates are located here...

    C:\Users\{username}\.nuget\packages\Microsoft.VisualStudio.Web.CodeGenerators.Mvc\1.0.0-preview2-final\Templates

    Copy the Templates folder to your project and edit them as required.

    0 讨论(0)
  • 2020-12-01 02:24

    You can enable code generation rather than copying from templates folder.

    Using the tutorial Asp.Net Core Using existing db

    Tools > Nuget Package Manager > Packagae Manager Console

    Run the following commands one after the other. Make sure you have internet connection.

    Install-Package Microsoft.EntityFrameworkCore.SqlServer
    Install-Package Microsoft.EntityFrameworkCore.Tools
    Install-Package Microsoft.VisualStudio.Web.CodeGeneration.Design
    

    Rebuild the solution. Then right click on the controller folder > new > controller...

    0 讨论(0)
  • 2020-12-01 02:28

    I´m using Visual Studio 2017 and asp.net Core 2.0, and after search a lot, I´ve just found the Templates on this place: C:\Program Files\dotnet\sdk\NuGetFallbackFolder\microsoft.visualstudio.web.codegenerators.mvc\2.0.0\Templates

    I hope this could help someone with the same issue... ;)

    0 讨论(0)
提交回复
热议问题