I have the following code:
context.MyEntities.AddObject(new Entity() { Id = 1 });
var entity = context.MyEntities.Where(e => e.Id == 1).FirstOrDefault();
I didn’t call save changes yet, so i’m trying to retrieve the object that i added, but the entity is null. Why?
Solved!
With Randolf answer, i reach the following solution: