Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

Professional Opinions
Ask a Question
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

troubleshooting Question

Entity Framework Detecting Changes

Avatar of MRS
MRSFlag for United States of America asked on
.NET Programming
1 Comment1 Solution1221 ViewsLast Modified:
I am currently using the entity framework as a data layer for an application.  I am still learning the EF so i might have some of the nameing conventions off.

I have a context Person object that i am displaying to the user via a group of bound controls.  When the user closed the form i would like to detect whether any changes have been made to the object.  If there have been, then i will prompt them to save the changes.

I have everything working well, but i can't seem to figure out how to detect if the object has changed.  I see that my Context Object has a .DetectChanges, but that doesn't seem to return what i would expect.

Is there a way to tell whether changes has been made to an object in the EF?

Thanks in advance.
Avatar of Adam Menkes
Adam MenkesFlag of United States of America imageC# ASP.NET Developer
This problem has been solved!
Unlock 1 Answer and 1 Comment.
See Answers