Skip to content

C# Feature - Modifiers on simple lambda parameters

C# 14 allows simple lambda parameter lists to include modifiers such as ref, out, in, ref readonly, and scoped without forcing explicit parameter types for every parameter.

This feature was introduced in C# 14. The official Microsoft Learn page for C# 14 is dated November 18, 2025 and states that C# 14 ships with .NET 10 and Visual Studio 2026.

Before C# 14, adding a modifier like out to a lambda parameter forced the lambda back into a fully typed parameter list. That made concise lambdas noticeably noisier.

TryParse<int> parse = (string text, out int result) =>
int.TryParse(text, out result);
TryParse<int> parse = (text, out result) =>
int.TryParse(text, out result);
  • Use it when the delegate shape is already clear from the target type.
  • Use it to keep lambdas concise in APIs that rely on ref, out, or similar modifiers.
  • The params modifier still requires an explicitly typed parameter list.
  • If the target delegate is not obvious, the shorter syntax can make code harder to read.