This particular style of function is not supported by C# as a single line declaration. You have to separate out the declaration and definition into 2 lines
Func<int, int> fac = null;
fac = n => (n <= 1) ? 1 : n * fac(n - 1);
More Related Contents:
- lambda expression to sort on min values in a group
- why does this recursive program for factorial not work? [closed]
- Is there a reason for C#’s reuse of the variable in a foreach?
- Getting all types that implement an interface
- C# Lambda expressions: Why should I use them?
- convert a list of objects from one type to another using lambda expression
- Sorting a list using Lambda/Linq to objects
- Recursively Get Properties & Child Properties Of A Class
- Cannot use ref or out parameter in lambda expressions
- C# Lambda ( => ) [duplicate]
- Can I specify my explicit type comparator inline?
- Wrapping StopWatch timing with a delegate or lambda?
- How do I create an expression tree to represent ‘String.Contains(“term”)’ in C#?
- How do I pronounce “=>” as used in lambda expressions in .Net [closed]
- Entity Framework Filter “Expression”
- lambda expressions in immediate window for VS2015
- Generate tail call opcode
- Proper Currying in C#
- Fastest way to Remove Duplicate Value from a list by lambda
- Peculiar overload resolution with while (true)
- List complex sorting
- How can I capture the value of an outer variable inside a lambda expression?
- Recursive TreeView in ASP.NET
- Can lambda functions be recursive? [duplicate]
- How do I dynamically create an Expression predicate?
- Is there a way to specify an “empty” C# lambda expression?
- Is there a better way to express a parameterless lambda than () =>?
- Lambda Expression for join
- Getting names of local variables (and parameters) at run-time through lambda expressions
- ‘Delegate ‘System.Action’ does not take 0 arguments.’ Is this a C# compiler bug (lambdas + two projects)?