Hi,
In our WPF app implemented using Prism and MEF, UI layer is MVVM based and EF has been used in DAL.
When the data changes on one screen, we want to ensure that all open screens display the updated data. E.g. if we add a new customer in Add Customer screen, then the already open Search Customer should be refreshed with the newly added customer.
Currently we are using the EventAggregator and Publisher-Subscriber pattern for refreshing the data. The ViewModels (in UI layer) and the DbContext (in DAL) are disconnected. The ViewModels get the updated data by calling the methods in DAL.
Is there another way of ensuring that data is up-to-date across the application? I heard we can have one DbContext for the whole application to ensure this. Is that the right way to go when the data can be huge?
Please advise.
Thanks.
In our WPF app implemented using Prism and MEF, UI layer is MVVM based and EF has been used in DAL.
When the data changes on one screen, we want to ensure that all open screens display the updated data. E.g. if we add a new customer in Add Customer screen, then the already open Search Customer should be refreshed with the newly added customer.
Currently we are using the EventAggregator and Publisher-Subscriber pattern for refreshing the data. The ViewModels (in UI layer) and the DbContext (in DAL) are disconnected. The ViewModels get the updated data by calling the methods in DAL.
Is there another way of ensuring that data is up-to-date across the application? I heard we can have one DbContext for the whole application to ensure this. Is that the right way to go when the data can be huge?
Please advise.
Thanks.