3 public sealed class Thing
<TFirst
> where TFirst
: class
5 public static Thing
<TFirst
> Create
<TSecond
> (Func
<TFirst
, TSecond
> fn
)
8 return new Thing
<TFirst
> (
9 delegate (TFirst item
) {
10 TSecond foo
= item
== null ? null : fn (item
);
11 Console
.WriteLine (foo
);
15 public void SomeAction ()
20 private Thing (Action
<TFirst
> fn
)
28 public static class Program
30 public static void Main ()
32 var foo
= Thing
<object>.Create (x
=> x
);