title: Method to return records true false or all
body: <p>Is there a better way to write the method below? I want to return content based on a <code>bool</code> variable <code>IsPublished</code>.</p>
  
  <p>When <code>IsPublished</code> is <code>null</code> I want to return entries that are both <code>true</code> and <code>false</code>.</p>
  
  <pre><code>public IList&lt;Content&gt; GetContent(bool? IsPublished)
  {
      if (IsPublished != null)
      {
          return _UoW.Content.All.Where(c =&gt; c.IsPublished == IsPublished).ToList();
      }
      else
      {
          return _UoW.Content.All.ToList();
      }
  }
  </code></pre>