From ff21146a67c548243f81aef6af8188962ecfe299 Mon Sep 17 00:00:00 2001 From: f-frhs Date: Fri, 5 Jun 2020 20:07:09 +0900 Subject: [PATCH] Change: To use Func, Action and Predicate --- .../Test1_FuncVsActionVsPredicate/Program.cs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/ApressCodesForInteractiveCSharp/PartII/Ch11_AnonymousMethod/Test1_FuncVsActionVsPredicate/Program.cs b/ApressCodesForInteractiveCSharp/PartII/Ch11_AnonymousMethod/Test1_FuncVsActionVsPredicate/Program.cs index ca3446b..8b553c7 100644 --- a/ApressCodesForInteractiveCSharp/PartII/Ch11_AnonymousMethod/Test1_FuncVsActionVsPredicate/Program.cs +++ b/ApressCodesForInteractiveCSharp/PartII/Ch11_AnonymousMethod/Test1_FuncVsActionVsPredicate/Program.cs @@ -10,19 +10,19 @@ static void Main(string[] args) //Func Console.WriteLine("<---Using Func--->"); Func student = new Func(ShowStudent); - Console.WriteLine(ShowStudent("Amit", 1)); - Console.WriteLine(ShowStudent("Sumit", 2)); + Console.WriteLine(student("Amit", 1)); + Console.WriteLine(student("Sumit", 2)); //Action Console.WriteLine("<---Using Action--->"); Action sum = new Action(SumOfThreeNumbers); - SumOfThreeNumbers(10, 3, 7); - SumOfThreeNumbers(5, 10, 15); + sum(10, 3, 7); + sum(5, 10, 15); //Predicate Console.WriteLine("<---Using Predicate--->"); Predicate isGreater = new Predicate(GreaterThan100); - Console.WriteLine("125 is greater than 100? {0}", GreaterThan100(125)); - Console.WriteLine("60 is greater than 100? {0}", GreaterThan100(60)); + Console.WriteLine("125 is greater than 100? {0}", isGreater(125)); + Console.WriteLine("60 is greater than 100? {0}", isGreater(60)); Console.ReadKey(); }