tag:blogger.com,1999:blog-6082652835152798567.post4555077407471519186..comments2024-03-28T00:58:12.736-07:00Comments on Sql server, .net and c# video tutorial: Part 15 - Identity Cache in Linq to SQLUnknownnoreply@blogger.comBlogger1125tag:blogger.com,1999:blog-6082652835152798567.post-84105863788453909722016-07-06T23:02:53.529-07:002016-07-06T23:02:53.529-07:00Hi,
Thanks for all your great tutorials. They are...Hi,<br /><br />Thanks for all your great tutorials. They are really simple and concise. I'm having an issue with this identity cache,<br /><br />I tried running the first part of this tutorial.. <br /><br /> Student S1 = dbContext.Students.FirstOrDefault(x => x.ID == 1);<br /> Student S2 = dbContext.Students.FirstOrDefault(x => x.ID == 1);<br /> Console.WriteLine("S1 == S2 : {0}", object.ReferenceEquals(S1, S2));<br /><br />For me the select statement gets triggered twice, and Console.writeline returns false. Is there anything which needs to be done to turn on or off identity cache?<br /><br />Thanks..Anonymoushttps://www.blogger.com/profile/02415502271287508480noreply@blogger.com