63/66
\begin{frame}[fragile]
  \frametitle{LinQ: Under the Hood}
  
  \begin{code}{\textwidth}{}
    \begin{lstlisting}[language=Java,basicstyle=\ttfamily\small,morekeywords={var,from,in,Where,Select,foreach,Console,orderby}]
var contacts =
  customers
  .Where(c => c.State == "WA")
  .Select(c => new{c.Name, c.Phone});
    \end{lstlisting}
  \end{code}
  \pause
  
  Here customers is of type IEnumerable.
  \medskip
  
  IEnumerable<...> provides methods for querying:
  \smallskip
  
  \begin{code}{\textwidth}{}
  \begin{lstlisting}[language=Java,basicstyle=\ttfamily\small,morekeywords={var,from,in,Where,Select,foreach,Console,orderby}]
public static IEnumerable
         Where(this IEnumerable src, 
                  Func> p);
  \end{lstlisting}
  \end{code}
  \pause
  
  \begin{goal}{}
    \sql{Func> p} converted on-the-fly in an \emph{expression tree} (a delegate). % \sql{Expression> p}.
    This is then translated into an SQL expression...
  \end{goal}
\end{frame}