I'm using Entity Framework in version 6.2.0.
And I have a simple question about this framework.
Is it possible to insert/add record, and select this same record before using SaveChanges
function??
I'll try to represent this by simple code:
// prepare and add new record
User u = new User();
Context.Users.Add(u);
Context.Entry(u).State = EntityState.Added;
var y = (from x in Context.Users).FirstOrDefault(); // return null
// i expected that, in here i found new Created User
Context.SaveChanges();
var y = (from x in Context.Ussers).FirstOrDefault(); // return != null
I'm doing this, because i'm going to join a created record with a few other tables.