First query generates CAML without ID condition. Does it mean, that all items are read and query is executed in memory?
var result = db.Agreements.Single(i => i.Id == 8);
<Query><Where><BeginsWith><FieldRef Name="ContentTypeId" /><Value Type="ContentTypeId">0x010</Value></BeginsWith></Where></Query>
Second query generates CAML with ID condition:
var result = db.Agreements.Where(i => i.Id == 8).Single();
<Query><Where><And><BeginsWith><FieldRef Name="ContentTypeId" /><Value Type="ContentTypeId">0x010</Value></BeginsWith><Eq><FieldRef Name="ID" /><Value Type="Counter">8</Value></Eq></And></Where></Query>
Single is not mentioned as unsuported command. Does anybody have explanation for this behavior of LINQ to SP?
https://msdn.microsoft.com/en-us/library/ee536585.aspx#sectionSection0