Domanda

I'm just a starter and asking a simple question.. Just need a direction where to move. Can someone explain in very few words the process of application development using WPF+MVVM pattern (using Catel) with database created with Entity Framework. 1. I create models (Code First) and generate database 2. I create View models via Catel base classes 3. I create Views with WPF

The question is: how to connect database with Catel View Models? Where to load DBContext and entities? Should I create repositories? Or maybe it's needed to create separate Models? Is there a common way or maybe example of a small WPF application which uses database to store data?

Sorry if my question is slightly heretic - simply can't sort all the terms and approaches into a single system which I will follow during app creation...

È stato utile?

Soluzione

Though there are technical discussions in the field what is best way, there are two commonly used scenarios:

1) Using repositories (Catel does support implementations of repositories for both EF5 and EF6) 2) Use a service that will handle the functions and call that in the view model like any other service.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top