Addin for Visual Studio that generates C# MVC.

  • Visual Options for MVC Generation.
  • Generates Master Detail views of data models.
  • Generates drop down lists for external cross reference tables.
  • Generates optional search for fields/drop down lists
  • Generates date pickers.
  • Generates Strongly Modeled Views
  • Great way to start a project or learn MVC.
  • Comparable to scaffolding.

Requires ASP.NET MVC3

Install it from http://www.asp.net/mvc/mvc3

Quick Start:

Start a new C# MVC project.
(File->New Project->Visual C#->ASP.NET MVC 3 Web Application)

Add a Data Model.
Project->Add New Item->Visual C#->Data->ADO.NET Entity Data Model

Run the addin

Right Click your project in Solution Explorer-> :) MVCGenerator
MVCGeneratorMenu.png

Choose options

Select generation options then click generate.
MainView.png
  1. The Project that you want to use.
  2. The Entity Container that you want to use.
  3. The Entity Type that you want to generate from.
  4. Generate Button - Clicking will create the MVC Models, Views and Controllers.
  5. Add a Link on View/Index - Will create a link on the default project Index page for fast testing.
  6. Check Shared _Layout for JavaScript - Will put the correct JavaScript /css options for MVC.
  7. Field Name - The name of the field for each generation option.
  8. Data Type - Just information message to guide in generation options.
  9. Show In Master View - Whether or not to show this field on the master view.
  10. Show in Detail View - The mode used to generate this field on the edit view.
  11. Is Searchable - Allows the field to be searched/Filtered on the Master view.
  12. Combo Box Column - The Foreign table that the field is linked to.
  13. Key - The Foreign key field that this column is linked to.
  14. Display Field - The Foreign field to Display in the Master/View/Edit views.

How to install

Installing the addin in Visual Studio

Get the latest MVCGenerator.dll from the Download Button.

Copy the MVCGenerator - For Testing.AddIn File to your Addins folder:
C:\Users\YourUserName\Documents\Visual Studio 2010\Addins
or
C:\Users\YourUserName\Documents\Visual Studio 2012\Addins

Download the File here -> MVCGenerator - For Testing.AddIn <-

Example of the MVCGenerator - For Testing.AddIn File

Edit the .AddIn File and change the <Assembly>Path</Assembly> to the full path to the MVCGenerator.dll

<?xml version="1.0" encoding="UTF-16" standalone="no"?>
<Extensibility xmlns="http://schemas.microsoft.com/AutomationExtensibility">
<HostApplication>
<Name>Microsoft Visual Studio</Name>
<Version>10.0</Version>
</HostApplication>
<Addin>
<FriendlyName>MVCGenerator - No Name provided.</FriendlyName>
<Description>MVCGenerator - No Description provided.</Description>
<Assembly>c:\MVCGeneratorInstallFolder\MVCGenerator.dll</Assembly>
<FullClassName>MVCGenerator.Connect</FullClassName>
<LoadBehavior>1</LoadBehavior>
<CommandPreload>0</CommandPreload>
<CommandLineSafe>0</CommandLineSafe>
</Addin>
</Extensibility>

Other Projects

Fast C# or VB Webform Generation
Try my other project: http://sqltoaspx.codeplex.com

Last edited Jul 31, 2013 at 6:03 AM by DanielHarrod, version 29