title: LINQ select into array
body: <p>I am trying to modify a LINQ query to select some properties into an array but am struggling to achieve part of it.</p>
  
  <pre><code>    toRun.AddRange(entity.Properties
          .Select(property =&gt; property.PrimaryField)
          .Select(field =&gt; new { field, entity = entity.EntityName, table = field.Table, key = entity.EntityIdField })
  </code></pre>
  
  <p>I need this amending so that if a second property called SecondaryField is not null or empty string it will be added to the results of the first Select statement.</p>
  
  <p>For example if entity.Properties contains:</p>
  
  <pre><code>    Property { PrimaryField = "a", SecondaryField = "b" },
      Property { PrimaryField = "c", SecondaryField = "" }
  </code></pre>
  
  <p>I would like the first Select statement to return:</p>
  
  <pre><code>    { "a", "b", "c" }
  </code></pre>
  
  <p>Appreciate any help thanks.</p>