From the course: Advanced C# Programming Concepts
Unlock this course with a free trial
Join today to access over 24,700 courses taught by industry experts.
Challenge: Lambda functions - C# Tutorial
From the course: Advanced C# Programming Concepts
Challenge: Lambda functions
(upbeat music) - [Instructor] All right, it's time for another programming challenge. In this challenge, we're going to use lambdas to revisit an earlier challenge. So recall that in our previous challenge, we implemented a piggy bank watching program that used an event to track whenever the balance amount in the piggy bank changed. So in this challenge, you're going to re-implement the piggy bank challenge using a lambda function for your event handler. So here in the start code, you're going to use a lambda function for the event handler instead of the named event handler that we used before. So go back and take a look at your earlier solution, or mine if that's what you used, and then perform the same challenge again, but use a lambda instead of a separate delegate function to create the solution. And in the next video, I'll show how I arrived at my solution. So take a few minutes, try this out, and then come back and compare your code with mine.