FULL LINE Business Applications - PRISM MEF Entity Framework - Examples?

Are there any examples / tutorials / information on more complex business applications? There is a lot of information about understanding PRISM, MEF, MVVM, Entity Framework, common repositories, mechanics behind the prism and other MVVM infrastructures such as regions, navigation, etc.

I know how to connect to a database and switch views and create a basic application.

so at this moment I have a DataGrid with a list of my database objects. Let's say that at this moment I even have templates, and all this looks good for viewing.

How do you implement the last part of this to perform CRUD operations. Is it better to edit directly in the DataGrid and have update / add / delete buttons? Should it be updated when the line changes? What if I want a custom modal view to show for editing / adding data? What is the best practice for actual data manipulation?

Are there any examples of the PRISM / MVVM / Entity Framework application that you can run and actually view / edit / delete records in the database?

All the examples that I found do not specify how / why you should implement the final implementation of the data.

Quote from another answer on a similar question:

The samples included in PRISM cover everything you need. In addition, PRISM concerns the composition of the user interface, access to data is beyond the scope.

My question is how to access data using PRISM, modal viewing, edit directly in the grid, etc.

Samples do not cover everything that I need, if in one sample there was a window listing the data in the database and providing the CRUD functions, then this will be true. Are there any patterns that show how this all works together?

+4
source share
1 answer

Having done something similar in the past, I will create a data service whose only task is to facilitate data requests to / from the database and user.

The data service is the only part that really knows how to talk to db, and these details should be confused from consumers (your viewing models, etc.).

After creating the data service, the service will hold an editable set of tuples, process the changes for all and all of them, and expose them directly to bind to the view, ideally through the ICollectionView interface.

Then, it’s just a matter of introducing this service into your vm (ideally through an interface to keep the object unified testable).

I know that these concepts are all of a high level, but that kind of everything that I can give you at this moment. This is a project that I wrote some time ago to demonstrate MVVM, and it has this idea in place, although the data warehouse is not a database (but it is not limited to the concept of a data service). Feel free to delve into the source code of the project, and I hope you find something useful there.

0
source

Source: https://habr.com/ru/post/1493858/


All Articles