Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
C# の無名関数の構文を理解しようとしていますが、意味がわかりません。これが有効な理由
Func<string, string> f = x => { return "Hello, world!"; };
しかし、これはそうではありませんか?
Func<string> g = { return "Hello, world!"; };
関数定義を知る必要があります。
1 つのパラメーターを持ち、TResult パラメーターで指定された型の値を返すメソッドをカプセル化します。
参考文献:
マイクロソフト