C# Default Parameters

前端 未结 4 1341
闹比i
闹比i 2020-12-30 08:32

This is, probably, a very simple answer for someone. I have a method with an Optional Parameter like so;

public static Email From(string emailA         


        
4条回答
  •  生来不讨喜
    2020-12-30 09:21

    If you compile that up and examine the output using a tool like ILDASM you'll see that the optional parameter is simply implemented by adding an attribute to the metadata that describes the method's formal parameters. As long as that attribute class is available on the target platform there should be no problem with using the emitted code on a downlevel platform.

提交回复
热议问题