Tanvir
Tanvir

Reputation: 3

Generating view with scaffolding for ASP.NET MVC3

I'm doing a project with ASP.NET MVC3 and Linq to Entity . I have separated my data access layer through a different project and of course its not highly coupled with Model.

I have seen the scaffolding ( auto code generation for controller and corresponding views) feature which depends on Model.

Is there any tools or specific procedure through which I will be able to generate views for a specific controller like scaffolding do for ASP.NET MVC without involving model highly like MVC do ?

Thanks

Upvotes: 0

Views: 835

Answers (2)

Pieter Germishuys
Pieter Germishuys

Reputation: 4886

The model that you are talking about here doesn't have to be a Database generated class. It can be anything, so what I would do is create a ViewModel (class) that will represent that view you want to display and use the Scaffolding functionality on that ViewModel.

You can then use something like an Automapper to bind your models to the view models

Upvotes: 0

Eranga
Eranga

Reputation: 32447

You can go through the MVC Scaffolding articles. Basically what you have to do is edit the default templates and power shell scripts.

Upvotes: 1

Related Questions