I am very new to Entity Framework. In my application, I have first created an entity and got it saved in the database. Next, I have made some changes to the in-memory entity but before I saving the current changes to the database, I want to compare the values with what I have saved previously in the database. 

When I am trying to load the entity from the database, EF in turn returns the entity which is currently in memory. 

I am interested in knowing, how can I fetch an entity from database and also keep it separate from the current in-memory modified entity?

Sample Code

```
// new entity being created
Person p1 = GetPersonEntity();
p1.Age = 20;
Guid p1Id = _personRepository.AddOrUpdate(p1);

// An update but before saving I want to compare the new age with what was saved previously
p1.Age = 25;
Guid tempId = _personRepository.AddOrUpdate(p1);

// For comparison when I try to fetch entity from database, 
// I am getting the current in memory modified entity
_personRepository.FindBy(x => x.Id == p1Id).FirstOrDefault(); // doesn't return values from database

```

Thanks