I am trying to grasp Lambda usage and put together a very simple winform test app that copies the content of one textbox to another textbox and adds a little bit of additional text from a button click event. Here is a picture of what I am doing and the code below that. The question is if this could be done with a Lambda and what would that look like? Or -- if my test app does not lend itself for Lambda usage could someone suggest a simplistic scenario like mine where a Lambda could be used?
Here is the code behind
using System; using System.Linq; using System.Windows.Forms; namespace testThing1 { public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void button1_Click(object sender, EventArgs e) { textBox2.Text = Thing1.ReadThing(textBox1.Text); } } class Thing1 { public static string ReadThing(string txt) { return txt + " -- return Thing"; } } }
Thanks
Rich P