mam ten kod:Jak zrobić int tablica Nullable?
var contractsID = contracts.Select(x => x.Id);
int?[] contractsIDList = contractsID.ToArray();//for debug
W tej linii:
int?[] contractsIDList = contractsID.ToArray();//for debug
otrzymuję ten błąd:
Can not implicitly convert type int[] to int
co próbuję zrobić, to zrobić typ contractsIDList pustych.
Jak zrobić int tablicę Nullable?
[C# tablice dopuszczające wartość null] (http://stackoverflow.com/questions/16069997/c-sharp-nullable-arrays) –
Dlaczego chcesz mieć tablicę zerową? Jako typ odniesienia jest już nullable. –
Nie rozumiem komunikatu o błędzie. Czy 'x.Id' jest' int? 'Lub' int'? Czy rzeczywiście chcesz utworzyć 'int? []' Z 'int []'? –