以下の内容はhttps://rksoftware.hatenablog.com/entry/2021/11/01/233622より取得しました。


拡張プロパティのパターン

■ C# 10.0 での新機能

・拡張プロパティのパターン (Extended property patterns)
  https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/proposals/csharp-10.0/extended-property-patterns
 プロパティの中のオブジェクトのプロパティをシンプルな記述でパターンマッチングできる。

SampleA a = new();

// プロパティの中のプロパティをシンプルに書ける
if (a is SampleA { PropertyA.PropertyB: 1 })
{
}

// 構造体定義
struct SampleA
{
    public SampleB PropertyA { get; set; }
}

struct SampleB
{
    public int PropertyB { get; set; }

}



以上の内容はhttps://rksoftware.hatenablog.com/entry/2021/11/01/233622より取得しました。
このページはhttp://font.textar.tv/のウェブフォントを使用してます

不具合報告/要望等はこちらへお願いします。
モバイルやる夫Viewer Ver0.14