Why can’t c# use inline anonymous lambdas or delegates? [duplicate]

Lambdas in C# do not have types, until they are used in a context that casts them to a delegate or Expression type.

That’s why you cannot do the following:

var x = () => "some lambda";

You might enjoy Eric Lippert’s Series on Lambda Expressions vs Anonymous Methods

Leave a Comment