P B
P B

Reputation: 83

Transitioning from ASP.NET Web Forms to MVC

I have drawn a table of comparable components between Asp.Net web forms and MVC to help transition to MVC Razor View.

Is the mapping of Entity and DAO classes as listed in my table correct? Please suggest.

    Web Forms            |    MVC (Razor View)
--------------------------------------------------
  Web Page (.aspx)       |  View (.cshtml) 
  User Control (.ascx)   |  Partial View (.cshtml)
  Master Pages           |  Shared Layout (.cshtml)
  Code Behind            |  Controller
  Entity Classes         |  Model Classes - ?
  DAO Classes            |  Repository Classes - ?

Upvotes: 0

Views: 690

Answers (2)

Rinat Galyautdinov
Rinat Galyautdinov

Reputation: 255

Your Entity classes are gonna be your Model - but it's only for the small and simple projects For the real projects you would need a ViewModel which might contains several Models from your EF Your DAL will be a separated project used either by Helpers or Repository which finally will be used by your Controllers. Migration a web forms into MVC is not a simple process just like you wrote in the table above. It's almost the same as creation of the app from the scratch. You can not just copy your "Views" and everything from your code-behind into the Controllers.

Upvotes: 1

Teddy
Teddy

Reputation: 1417

Web Forms and MVC are about the Presentation Layer, so you don't need to include DAO/Repository here. And your Entity Classes is not relevant with Model Classes. You can also have a Model Class in Web Form but in most cases it's eliminated.

Upvotes: 1

Related Questions