When having a query like this
var id = 1;
var query = (from c in cTable.Where(x => x.Id == id)
from a in aTable.Where(x => x.Code == c.Code).DefaultIfEmpty()
select new Object()
{
Id = c.Id,
Code = c.Code,
}).FirstOrDefault();
Does the query search first all the c where Id is equal to id and then retrieve the first one with FirstOrDefault(), or does the query already stop at the first c found?
If it doesn't stop searching until the end (and then apply the FirstOrDefault), is there a way to let the query stop at the first found?