My belief has always been that if BigDataSet
is an entity and you assign var someThing = Context.BigDataSet.Single(x => x.Name.Trim().ToUpper.Equals(someName.Trim().ToUpper()));
then EF will do some magic to translate your lambda expression into a query, like
SELECT * FROM big_data_set WHERE name = (someName)
But after thinking about it, I can't see a way that it works except by keeping the results of Context.BigDataSet
in memory and then performing the search.
Do EF DbSet
lambda expressions get turned into SQL, or is it all applied after-the-fact?
Edit: If they do get turned into SQL, how does EF
get to "see" the entire stack of things that are going to happen after it fetches the name? If I call instance.MethodA().MethodB()
, doesn't that usually mean methods A
and B
are executed sequentially?