Search code examples
c#asp.net-mvcmodel-view-controllerscaffoldingsidewaffle

How to create a Custom Scaffolding in multiple projects (mvc + class libraries)


I have a project consisting of few projects (one MVC Application and 3 class libraries for business logic and data access). I am new to building scaffolding extension and was wondering if I can create a Custom Scaffolder which can generate

  1. Controller, ViewModel and Views in my MVC Application Project
  2. Add some files and folders in Other Projects, that are of type Class Library.

Until now, I have achieved the 1st target (it was fairly easy) but I am unable to find any method to add files to other projects.

I was wondering if there is no direct way of doing it, maybe I can just navigate to the folders in the directories of other projects and create the files. Then include them in my project manually.

P.S. I am using the basic scaffolder template by SideWaffle

Thanks for all the answers in advance.


Solution

  • Sorry, but this extension is no longer available, I have discontinued it

    I created an extension for Visual Studio that lets you accomplish this with T4 Templates. You should be able to hit both targets but for number one you will need to do some extra work. I don't integrate with existing scaffolding stuff so you will have to write your own but my extension makes it easy. Its up on Visual Studio gallery and I have a demo/training video you can watch to see how to generate multiple files across multiple projects. Full disclaimer, I charge for this but do offer a free community version.