title: Working MvvM and Concurrency
body: <p>I am developing an application using WPF and MvvM, written in C#. I am still a beginner with the some of the concepts of MvvM and the entity framework. I have what seems like everything working except the concurrency issue. I worked through this <a href="http://msdn.microsoft.com/en-us/library/ms171936.aspx" rel="nofollow">Microsoft article</a>, and it didn't work for me. So, like the MvvM structure, I have a model and entities file called <em>BackflowManagementEntities</em>. I then have a repository which handles the update for a tester. I inserted try and catch here for testing and no luck.</p>
  
  <pre><code>private BackflowManagementEntities dbContext;
  internal void SaveChanges()
  {
        try
        {
             dbContext.SaveChanges(); 
        }
        catch (DBConcurrencyException ex)
        {
             Console.WriteLine("Concurrency Exception : " + ex.Message);
        }
  }
  </code></pre>
  
  <p>So I have a three part question :</p>
  
  <ol>
  <li>This is the only place I can think of that I should be implementing the concurrency check. Please let me know if I am wrong.</li>
  <li>Is this the correct exception/way to check for the concurrency error? I understand how to deal with the concurrency error, I just don't know how to catch it.</li>
  <li>Is there any source you would recommend me reading on dealing with and catching concurrency exceptions?</li>
  </ol>