相关疑难解决方法(0)

您可以在面向.NET 3.5的代码中使用可选参数吗?

我正在寻找一个使用C#4.0新的可选参数功能的库,但我希望将其定位到框架的3.5版本.这可能吗?

可选参数语法糖的方式与扩展方法相同吗?

c# .net-4.0 visual-studio-2010

32
推荐指数
3
解决办法
3万
查看次数

C#上不允许使用默认参数说明符错误

当我构建项目时,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)

可能是我的错误?

c# .net-3.5 default-parameters

3
推荐指数
1
解决办法
6795
查看次数