vendredi 8 avril 2016

How to use MVC domain model in a 4 layer project?

I have a 4 layers(project) Solution.

  1. Entity Framework Layer (EFL)
  2. Data Access Layer(DLL): All of CRUD operations and queries.
  3. Business Logic Layer(BLL): Calling DLL methods and adding some business to them.
  4. MVC Layer

As I said I have a separate EFL layer and because of this I don't know How can I use benefits of models in MVC? for example I can't write validation Annotations like <required> or <Display(Name:="username:")> in EFL layer because probably they will delete if I generate model from database again. and even if I do that How I can use Model folder of MVC?

If I create some class same as EFL classes I need to write a huge bunch of code to convert these classes to each other.

As what structure I can use MVC Models? and combine them with Entity Framework classes?

Aucun commentaire:

Enregistrer un commentaire