Building Query Expressions Using the Enumerable Type and
Raw Delegates
Finally, if we want to build a query expression using the really verbose approach, we could avoid the
use of lambdas/anonymous method syntax and directly create delegate targets for each Func<>
type. Here is the final iteration of our query expression, modeled within a new class type named
VeryComplexQueryExpression:
class VeryComplexQueryExpression
{
public static void QueryStringsWithRawDelegates()
{
Console.WriteLine("***** Using Raw Delegates *****");
string[] currentVideoGames = {"Morrowind", "BioShock",
"Half Life 2: Episode 1", "The Darkness",
"Daxter", "System Shock 2"};
Do'stlaringiz bilan baham: |