WPF Prism 7.0 Unity MVVM Entity Framework Guidance

Multi tool use
WPF Prism 7.0 Unity MVVM Entity Framework Guidance
I am creating an WPF MVVM application using Prism 7.0 and Unity. This is a composite application with a shell and multiple modules. I just about have the region management, etc. worked out to make the UI work, but I want to use EF6 as the data layer and I don't know how to make the DbContext available to the module ViewModels.
Is there any specific guidance on implementing this pattern, or, better yet, an example that illustrates it? I have found a lot of discussion surrounding this topic, but not enough to actually be able to do it.
Your models should wrap DBContext - nothing higher up should concern themselves with EF
– auburg
Jul 3 at 8:12
What "pattern" are you referring to? A DbContext generally lives in a data access layer (DAL). You might reference the DAL from your Prism modules or you might have some kind of service that uses the DAL to fetch the data from the database and then return the data to the client application.
– mm8
Jul 3 at 9:19
Sorry about the tag, it was an accident. My admittedly limited understanding of how this works is that the ViewModel supplies data to the View, which it gets from the Model (which in my case is implemented using EF6). If this is wrong please point me in the right direction. All I'm looking for is a little specific guidance.
– Bob Sculley
Jul 4 at 15:40
By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.
"how to make the DbContext available to the module ViewModels" - don't do that at all. View models must not be concerned about data access. Also: excellent choice of [unity3d] tag, did you at least read tag info?
– ASh
Jul 3 at 8:03