我正在寻找一个使用C#4.0新的可选参数功能的库,但我希望将其定位到框架的3.5版本.这可能吗?
可选参数语法糖的方式与扩展方法相同吗?
当我构建项目时,VC#表示不允许使用Default参数说明符.它引导我到这个代码:
public class TwitterResponse
{
private readonly RestResponseBase _response;
private readonly Exception _exception;
internal TwitterResponse(RestResponseBase response, Exception exception = null)
{
_exception = exception;
_response = response;
}
Run Code Online (Sandbox Code Playgroud)
可能是我的错误?
有办法解决这个问题吗?我是新手,我不明白......我试着用其他帖子解决这个问题,但我不知道......
public uint AddAllItemsByDefindex (int defindex, uint numToAdd = 0)
Run Code Online (Sandbox Code Playgroud)
"="符号出现错误"不允许使用默认参数说明符".
如果您需要从代码中了解其他内容以帮助我: 