This question is locked. New answers and comments are not allowed.
Hi,
I have a context with Visitors and I'm saving a new one and then retrieve it like:
sb will return null. I'm adding the new one to the context and then i'm quering this context so I thought it would find this newly inserted guy. This is not the case. Do I always need to do SaveChanges first?
Thanks!
I have a context with Visitors and I'm saving a new one and then retrieve it like:
string
name =
"Rico "
+ guid;
var b =
new
OADemo.Customer();
b.Lastname = name;
context.Add(b);
var sb = context.Customer.FirstOrDefault(x => x.Lastname == achternaam);
sb will return null. I'm adding the new one to the context and then i'm quering this context so I thought it would find this newly inserted guy. This is not the case. Do I always need to do SaveChanges first?
Thanks!