Related questions
C# Lambda Functions: returning data
Am I missing something or is it not possible to return a value from a lambda function such as..
Object test = () => { return new Object(); };
or
string test = () => { return "hello"; };
I get a build error "Cannot convert lambda expression …
Expression Trees and Invoking a Delegate
So I have a delegate which points to some function which I don't actually know about when I first create the delegate object. The object is set to some function later.
I also then want to make an expression tree …
Wrapping StopWatch timing with a delegate or lambda?
I'm writing code like this, doing a little quick and dirty timing:
var sw = new Stopwatch();
sw.Start();
for (int i = 0; i < 1000; i++)
{
b = DoStuff(s);
}
sw.Stop();
Console.WriteLine(sw.ElapsedMilliseconds);
Surely there's a way to call this …