O'Reilly logo

Entity Framework 4.1: Expert's Cookbook by Tim Rayburn, Devlin Liles

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Implementing refreshing data on save

In this recipe, we are going to look at how to get your application on a change to get the most current data it can, so that when you are modifying objects, you get the most current one back.

Getting ready

We will be using the Nuget Package Manager to install the Entity Framework 4.1 assemblies.

The package installer can be found at http://nuget.codeplex.com/.

We will also be using a database for connecting to the data and updating it.

Open the Improving Refreshing Data on Save solution in the included source code examples.

How to do it...

  1. We start be writing out a test that will allow us to define the scope of our problem. In this case, we want our context to refresh any object that it commits after the commit is ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required