public int[,] GetIntValue(ValueClass[,] values)
{
return values.Cast<ValueClass>()
.Select((x, i) => new { x?.Value, i })
.Aggregate(
new int[values.GetLength(0), values.GetLength(1)],
(accum, item) =>
{
accum[item.i / values.GetLength(1), item.i % values.GetLength(1)] = item.Value.GetValueOrDefault();
return accum;
});
}