2

What's the better way to use the Entity Framework with PRISM, MVVM and (Bussiness layer)? We have time to learn and the application(C#) will be 300 entities+.

I saw something about use the DI of PRISM together with EF, POCO (CodeFirst) directily, ModelFirst...

I dont have much experience with PRISM,MVVM, EF and DI, only a little theory.

what is the best architeture to do it?

Danilo Breda
  • 1,092
  • 1
  • 15
  • 30
  • Can you please be a little more specific about your problem? – Arashv Apr 24 '14 at 05:14
  • 1
    hire an experienced consultant to get you started? – jeroenh Apr 29 '14 at 07:09
  • Thats really not a specific question... but its something difficult to ask, sorry for that, but the real question was to know the best way to do a relation between EF and PRISM/MVVM. I cant be more specific than that. A consultant is a very good idea, we are trying to find someone. – Danilo Breda Apr 30 '14 at 06:23

1 Answers1

7

If I understand the question correctly, you've already got presentation and business layer based on PRISM architecture and you consider Entity Framework as data access layer.

The architecture

Julie Lerman has great course titled Entity Framework in the Enterprise available on Pluralsight. The course discusses best practices in terms of Entity Framework architecture in enterprise level applications which infers large sets of data.

EF lies in Data Layer, but Business Layer should depend on Repository/Unit of Work Layer. The essence of Repository Layer is to Encapsulate Redundant Data Access Code. The Repostitory consists of verbs like Get (GetCustomerById, GetAllCustomers), Add (AddCustomer), Remove (RemoveCustomer), Send (SendToDatabase).

The approach

Code first approach is the newest and I would recommend it. Comprehensive dissertation you can find on Code-first vs Model/Database-first topic on stackoverflow.

Domain Driven Design

Domain Driven Design (DDD) is a pattern that helps to manage large set of entities. It supports Separation of Concerns. Read more about it on dddcommunity. Watch the presentation Entity Framework in Core Business Applications and Domain-Driven Design Approaches that shows Entity Framework and DDD in practice.

Community
  • 1
  • 1
Ryszard Dżegan
  • 24,366
  • 6
  • 38
  • 56