我有与此类似的代码:
public xyz (int? a)
{
if (a.HasValue)
{
// here DoSomething has parameters like DoSomething(int x)
blah = DoSomething(a);
Run Code Online (Sandbox Code Playgroud)
我收到错误(无法从int?转换为int).有没有办法我可以将变量'a'传递给我的函数而不必这样做DoSomething(int? x)?