what is delegate and lambda expression? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

what is delegate and lambda expression?

27th Apr 2019, 11:01 AM
Khaled Halawa
Khaled Halawa - avatar
2 Answers
+ 3
Delegate : A delegate is a type. It is a very special type because an instance of this type can point to a method. A event is a instance of a delegate. When calling a event you start a method. https://www.sololearn.com/discuss/1289856/?ref=app https://www.sololearn.com/discuss/1057848/?ref=app https://www.sololearn.com/discuss/1709943/?ref=app https://www.youtube.com/watch?v=LDgQ-spnrYY Lambda : This is a short hand naming conventions for frequently used code Every where where you see " =>" That is a Lambda arr.ToList().ForEach( x => Console.WriteLine (x)); https://www.codingame.com/playgrounds/213/using-c-linq---a-practical-overview/lambda-expressions Func<int, int> multiplyByFive = num => num * 5; https://www.c-sharpcorner.com/UploadFile/bd6c67/lambda-expressions-in-C-Sharp/ https://www.tutorialspoint.com/Lambda-Expressions-in-Chash
27th Apr 2019, 9:07 PM
sneeze
sneeze - avatar
+ 1
thank you very much 💚
27th Apr 2019, 10:52 PM
Khaled Halawa
Khaled Halawa - avatar