Abstracting DbContext in WPF-Prism
<p>Trying to build a single user Desktop application using </p>

<ol>
<li>WPF as the UI</li>
<li>Prism for MVVM and other frills</li>
<li>Unity being the preferred DI</li>
<li>Entity Framework as the preferred ORM</li>
</ol>

<p>I've read about using EF in desktop scenario as above and guess the following are the two possible ways of going about it...</p>

<ol>
<li>Use the DbContext in the ViewModel directly (ties you to EF permanently)</li>
<li>Use the DbContext in the ViewModel via DI (abstraction)</li>
</ol>

<p>I prefer the second approach, and tried the following path.</p>

<ol>
<li>Use Interface and Implementation classes that abstract DbContext</li>
<li>Create a Service Layer that uses the above</li>
</ol>

<p>But now, I'm afraid I've lost all the cool change tracking that EF offers and my models are on their own to track their state and inform the DbContext of their state when reattached to it...</p>

<p>While its ok in a web app with WCF services and all... it seems overkill to enable my model with change tracking, for a simple single user desktop application...</p>

<p>Do I make any sense here? Am I getting anything wrong or missing something.</p>

<p>Need help, thanks in advance.</p>

<p>Cheers.</p>