2

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.

2 Answers 2

3

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).

Sign up to request clarification or add additional context in comments.

Comments

1

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

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.