public HalloDelegate() { EinfacherDelegate meinDele = EinfacheMethode; Action meinDeleAlsAction = EinfacheMethode; Action meinDeleAlsAction2 = () => { Console.WriteLine("Hallo"); }; DeleMitPara meinDeleMitPara = MethodeMitPara; Action <string> meinDeleMitParaAlsAction = MethodeMitPara; DeleMitPara meinDeleMitPara2 = x => Console.WriteLine(x); CalcDele meinCalc = Minus; long rsult = meinCalc.Invoke(4, 5); Func <int, int, long> calcFunc = Sum; CalcDele meinCalc2 = (x, y) => { return(x / y); }; CalcDele meinCalc3 = (x, y) => x / y; List <string> texte = new List <string>(); var result = texte.Where(Filter); var result2 = texte.Where(x => x.StartsWith("b")).OrderBy(x => x.Length).Take(3); }
public HalloDelegate() { EinfacherDelete meinDele = EinfacheMethode; Action meinDeleAlsAction = EinfacheMethode; Action meinDeleAno = delegate() { Console.WriteLine("lala"); }; Action meinDeleAno2 = () => { Console.WriteLine("lala"); }; Action meinDeleAno3 = () => Console.WriteLine("lala"); DeleMitPara deleMitPara = MethodeMitPara; Action <string> deleMitParaAlsAction = MethodeMitPara; Action <string> deleMitParaAlsActionAno = (string text) => { Console.WriteLine(text); }; Action <string> deleMitParaAlsActionAno2 = (text) => Console.WriteLine(text); Action <string> deleMitParaAlsActionAno3 = x => Console.WriteLine(x); CalcDelegate calc = Sum; Func <int, int, long> calcAlsFunc = Sum; Func <int, int, long> calcAlsFuncAno = (x, y) => { return(x + y); }; Func <int, int, long> calcAlsFuncAno2 = (x, y) => x + y; List <string> texte = new List <string>(); texte.Where(x => x.StartsWith("b")); texte.Where(Filter); }