title: LINQ DefaultIfEmpty should return array of object with null value
body: <p>I have this LINQ query:</p>
  
  <pre><code>Dim JoinedResult = LeftTable.GroupJoin(RightTable, Function(LeftTableRow) LeftTableRow(FieldIndexInLeftTable), _
                                       Function(RightTableRow) RightTableRow(FieldIndexInRightTable), _
                                       Function(LeftTableRow, RightTableRow) _
                                       New With {LeftTableRow, RightTableRow}).SelectMany(Function(Rows) Rows.RightTableRow.DefaultIfEmpty().Select(Function(Right) New With {Rows.LeftTableRow, Right}))
  </code></pre>
  
  <p><code>LeftTable</code> has 5 columns, <code>RightTable</code> has 2 columns.</p>
  
  <p>There is a match only in case of the first 11 rows:</p>
  
  <p><img src="https://i.stack.imgur.com/PT2M3.png" alt="enter image description here"></p>
  
  <p>The question is, how should I modify the <code>DefaultIfEmpty()</code>, that I get an object array with two elements, where each element is let's say nothing (the main point is, the elements should be null).</p>
  
  <p>I should do it in the way, that the column number of <code>RightTable</code> can be changing.</p>
  
  <p>Thanks.</p>
  
  <p>EDIT:</p>
  
  <p>I have the solution.</p>
  
  <p>I create an object array with 2 elements:</p>
  
  <pre><code>Dim NullValue() As Object = Nothing
  Array.Resize(NullValue, 2)
  NullValue(0) = DBNull.Value
  NullValue(1) = DBNull.Value
  </code></pre>
  
  <p>and then I use it in the <code>DefaultIfEmpty()</code> function like this: <code>DefaultIfEmpty(NullValue)</code></p>