[lang-ref] ( map_with_named_function ) ( csharp )
[Fact]
public void TestMapWithNamedFunction()
{
// items.Select(FuncName)
List<int> items = new() { 1, 2, 3 };
List<int> expected = new() { 2, 4, 6 };
int MultiplyByTwo(int x)
{
return x * 2;
}
var actual = items.Select(MultiplyByTwo).ToList();
Assert.Equal(expected, actual);
}