Download presentation
Presentation is loading. Please wait.
Published byJaden Walsh Modified over 11 years ago
1
Lambda Expressions Matt Van Horn Software Engineer Iverson Gaming Systems, Inc. www.anythingtheycando.com mattisgood@anythingtheycando.com mattisgood@anythingtheycando.com @phpn00b
2
We thank the following companies for their gracious sponsorship Platinum Sponsors Gold Sponsor
3
What is a Lambda Expression ( => ) Why should I use Lambda Expressions What is a Delegate?
4
Syntax => Goes To (input parameters) => expression () => SomeMethod() (int x, string s) => s.Length > x (x, y) => x == y (input parameters) => {statement;}
5
Expressions + LINQ Func(T, TResult) is the most useful type of lambda for the average developer. Strong typed input and output.Where(obj =>obj.Name == Matt) Compiler can normally guess the type for T
6
Dynamic Lists Example (input parameters) => expression Single statement
7
statements! Ask your self is it method worthy code? If not make it anonymous function! Declare single use code inline! Reduce the chance of lookup whiplash! Many private methods can be a lambdize!
8
Func == awesome! Easy way to store a lambda that you use over and over again! Func findMatt = p=>p.Name == Matt; var matts = people.Where(findMatt);
9
Action == useful! people.ForEach(p => p.FirstName = );
10
l
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.