Basically this is syntactic sugar, what you write in 10 lines with delegates and what you have can be done in a single line lambda expression. The main thing to take into account me is that when working with several developers in one project, you must make sure that its readability is still clear.
You can add an event inline Button1_Click += (sender, eventArgs) => { //myCode };
But you cannot reuse the event, and if there is a lot of code there, it will not help keep your code transparent.
You can also create a lambda to retrieve data from the <> list, but it can become unclear when there are many options where a good LINQ query can be much clearer.
This is basically a personal choice, but I have to say that I have used it quite a few times :)
Hope this helps a bit, Sam
source share