Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Quickest way to get Scaffold code created with C#/ASP.NET

At the start of any project, once you've got your object model there then comes a period of tedium as you crank out the skeleton code required.

Are there any tools that will help me with this task (including unit test skeletons if possible), a bit like the scaffolding feature in Rails?

Thanks.

like image 495
Ben Aston Avatar asked Dec 18 '08 11:12

Ben Aston


People also ask

What is scaffolding C#?

Basically, it is an automated code generation framework, it generates code for CRUD operations based on the provided domain model classes and DB connections. You can add scaffolding to your project when you want to add code that interacts with the data model in the shortest amount of time.

What asp net scaffolding is and why it is useful?

ASP.NET Scaffolding is a code generation framework for ASP.NET Web applications. Visual Studio 2013 includes pre-installed code generators for MVC and Web API projects. You add scaffolding to your project when you want to quickly add code that interacts with data models.

For which database operations does the scaffolding engine along with the Entity Framework create an instance for the mapped entity model and write its code?

Scaffolding blends with Entity framework and creates us the instance for the mapped entity model and writes down CRUD Operations code for us.

What is scaffolding in asp net core?

Scaffolding in ASP.NET Core is a technique used to generate code at design time to support a number of common application scenarios when working with Entity Framework Core. The code generation tool is available as a Nuget package.


1 Answers

It really depends on the framework stack that you're using:

  • Scaffolding for Monorail + ActiveRecord
  • ASP.NET MVC + Linq to SQL
  • Web forms + dynamic data
  • ASP.NET MVC + Subsonic

Other that than, you could always code your own "scaffolding" using CodeSmith or MyGeneration

Also see this related question

like image 170
Mauricio Scheffer Avatar answered Nov 15 '22 23:11

Mauricio Scheffer