See Linq cannot write values ββto the database if subordinates () are not called.
And for the second question, Yes, Linq cache objects before sending. We can also get entries that are in the cache but not transferred to the database.
When you inserted the record above, we can get the above records from the datacontext cache, as shown below:
First get the changeset from the DataContext as:
System.Data.Linq.ChangeSet MySet = ctx.GetChangeSet();
After that, extract your registration form. Changes:
MyRecord b = (MyRecord )MySet.Inserts.Last();
You will receive MyRecord with the title as the βtestβ that you entered.
Hope this helps.
Pankaj tiwari
source share