views:

317

answers:

2

Hi, I'm writing an application in wpf that uses MVVM. I wondered if I could use ado.net entity data model as a model in MVVM? Is it the same? If not, why? Thanks for any help. Regards, Ev.

+1  A: 

as I understand, one can use the entity model. but you will finally have tied coupling with the entity framework. whenever you plan to exchange your model for eg. with another ORM, you'll have more work to replace the model.

better is to use a repository pattern for data access. with this pattern you have more flexibility in the end. similar question here

SQueek
A: 

Sure, you can use the Entity Data Model as Model part of the MVVM Pattern.

You might have a look at the BookLibrary sample application of the WPF Application Framework (WAF).

This MVVM sample application uses Entity Framework data models as well and it is composed of various Views (UserControls).

jbe