Repository Pattern with Entity Framework 3.5 and MVVM
- by Ravi
I am developing a Database File System.
I am using -
.Net framework 3.5
Entity Framework 3.5
WPF with MVVM pattern
The project spans across multiple assemblies each using same model.
One assembly,let's call it a "server", only adds data to the database using EF i.e. same model.Other assemblies (including the UI) both reads and writes the data.The changes made by server should immediately reflect in other assemblies.
The database contains self referencing tables where each entity can have single OR no parent and (may be) some children. I want to use repository pattern which can also provide some mechanism to handle this hierarchical nature.
I have already done reading on this on Code Project. It shares the same context(entities) everywhere.
My question is - Should I share the same context everywhere? What are the advantages and disadvantages of doing that?