views:

603

answers:

3

Does anyone know of a good/usable ASP.NET MVC code/solution generator. Ideally it would build from a domain model, but from a data model is also acceptable.

If you do, can you answer the following:

  1. Does it produce "good" code?
  2. Can it be extended?
  3. What do you like and not like about it if you have used it?
  4. What great fearures does it come with that stand out?

If there isn't one you know of then do you think this is something missing from the community or do you not think it is needed? What features would you like to see in one?

Can't wait to hear your answers...

Thanks Scott

+3  A: 

S#arp Architecture includes scaffolding generator using T4. It generates model, views, controllers, and tests from the template model definition. You get full CRUD. Since it uses T4 (Visual Studio template language I suppose) you can extend default templates as you want.

Here's an example of the template:

EntityScaffoldingDetails entityScaffoldingDetails =
    new EntityScaffoldingDetails("Organization.Worker");

/*
 * Property names should be PascalCase.
 * Do not include a property for Id as it will be included automatically.
 */
entityScaffoldingDetails.EntityProperties.Add(
    new EntityProperty("FirstName", "string", "Joe", "[NotNull, NotEmpty]", true) 
);
entityScaffoldingDetails.EntityProperties.Add(
    new EntityProperty("LastName", "string", "Smith", "[NotNull, NotEmpty]", true)
);
entityScaffoldingDetails.EntityProperties.Add(
    new EntityProperty("BirthDate", "DateTime", DateTime.Parse("1/1/1975"))
);
entityScaffoldingDetails.EntityProperties.Add(
    new EntityProperty("Manager", "Employee", null, "[NotNull]")
);

///////////////////////////////////////////////////

// The first parameter should reflect the root directory of your solution
//ScaffoldingGenerator generator = new ScaffoldingGenerator(
    //@"D:\Work\Project\", "Orders", entityScaffoldingDetails); 

// Uncomment this line when you're ready for the scaffolding generator to fire...be sure to recomment after it completes to avoid accidental generating!
//generator.Run();

One small addition: I would not recommend using it as is, because, for example, I'd prefer controllers to work with ViewModel, not entities. And I don't use scaffolding much. But it is pretty flexible, though you may need to learn T4.

queen3
A: 

you can visit this

http://www.tabvn.com/blog/asp-net-mvc-generator

Toan
A: 

visit this: tabvn

http://www.tabvn.com/blog/asp-net-mvc-generator

asp.net mvc generator . auto general for add, view, edit, delete,

validate.

tabvn