diff --git a/DevTips/DevTips/Program.cs b/DevTips/DevTips/Program.cs index 9f4bdaf..b335e67 100644 --- a/DevTips/DevTips/Program.cs +++ b/DevTips/DevTips/Program.cs @@ -17,6 +17,9 @@ class Program // ActionClient.Client(); // Func - FuncClient.Client(); + // FuncClient.Client(); + + // Predicate + PreicateClient.Client(); } } diff --git a/DevTips/DevTips/Tips/ActionClient.cs b/DevTips/DevTips/Tips/ActionClient.cs index 8be16ef..83b3236 100644 --- a/DevTips/DevTips/Tips/ActionClient.cs +++ b/DevTips/DevTips/Tips/ActionClient.cs @@ -1,3 +1,5 @@ +using System; + namespace DevTips.Tips { class ActionClient diff --git a/DevTips/DevTips/Tips/FuncClient.cs b/DevTips/DevTips/Tips/FuncClient.cs index d8fc650..c32a097 100644 --- a/DevTips/DevTips/Tips/FuncClient.cs +++ b/DevTips/DevTips/Tips/FuncClient.cs @@ -1,3 +1,5 @@ +using System; + namespace DevTips.Tips { class FuncClient diff --git a/DevTips/DevTips/Tips/LinqGroupMinMax.cs b/DevTips/DevTips/Tips/LinqGroupMinMax.cs index 013bab2..15ff667 100644 --- a/DevTips/DevTips/Tips/LinqGroupMinMax.cs +++ b/DevTips/DevTips/Tips/LinqGroupMinMax.cs @@ -1,3 +1,4 @@ +using System; using System.Data; using System.Collections.Generic; using System.Linq; diff --git a/DevTips/DevTips/Tips/PreicateClient.cs b/DevTips/DevTips/Tips/PreicateClient.cs new file mode 100644 index 0000000..510d3ce --- /dev/null +++ b/DevTips/DevTips/Tips/PreicateClient.cs @@ -0,0 +1,18 @@ +using System; + +namespace DevTips.Tips; + +class PreicateClient +{ + public static void Client() + { + Predicate p = delegate(int n) + { + return n >= 0; + }; + System.Console.WriteLine($"p(-1): {p(-1)}"); + + Predicate p2 = s => s.StartsWith("A"); + System.Console.WriteLine($"p2(\"Apple\"): {p2("Apple")}"); + } +} \ No newline at end of file