What does the question mark in member access mean in C#?

后端 未结 2 1717
说谎
说谎 2020-12-04 02:10

Can someone please explain to me what does the question mark in the member access in the following code means?

Is it part of standard C#? I get parse errors when try

2条回答
  •  孤街浪徒
    2020-12-04 03:00

    In C# version 6 it will be shorthand for

    if (this.AnalyzerLoadFailed != null)
        this.AnalyzerLoadFailed.Invoke(this, new AnalyzerLoadFailureEventArgs(AnalyzerLoadFailureEventArgs.FailureErrorCode.NoAnalyzers, null, null));
    

提交回复
热议问题