title: return list, if empty AND count == 0. jump to else
body: <p>So I have a list of orders...and if the list is empty I want to to jump to the 'else.' </p>
  
  <p>But because its a list (even if its empty) there still is an instance of it? right? anyway if there are no orders it still goes into the if statement so I tried adding <code>.count == 0</code>...</p>
  
  <p>but it still goes into the if statement...what do I need to say where if there are no actual records in orders go to 'else....thanks for any replies    </p>
  
  <pre><code>IEnumerable&lt;OrderRecord&gt; orders = _orderService.GetOrdersByCustomer(id, OrderStatus.Completed).ToArray();
  
  if (orders != null &amp;&amp; orders.Count() == 0 )
  {
    //order exists
  }
  else
  {
      //no order
  }
  </code></pre>