Ho questo codice:Come rendere int array Nullable?
var contractsID = contracts.Select(x => x.Id);
int?[] contractsIDList = contractsID.ToArray();//for debug
In questa linea:
int?[] contractsIDList = contractsID.ToArray();//for debug
ottengo questo errore:
Can not implicitly convert type int[] to int
quello che cerco di fare è quello di rendere tipo contractsIDList Nullable.
Come rendere int array Nullable?
[array C# Nullable] (http://stackoverflow.com/questions/16069997/c-sharp-nullable-array) –
Perché vuoi un array nullable? Come tipo di riferimento è già annullabile. –
Non capisco il messaggio di errore. 'X.Id' un' int? 'O un' int'? Realmente vuoi creare un 'int? []' Da un 'int []'? –