title: Unable to marshal host object to interpreter space
body: <p>I'm trying to run this code, to get only the schedules that already started and not ended:</p>
  <pre><code>schedules.Where(x=&gt; DateTime.Today &gt;= x.StartDate &amp;&amp; DateTime.Today &lt;= x.EndDate)
  </code></pre>
  <p><code>schedules</code> is of type <code>List&lt;Schedule&gt;</code></p>
  <p>and the object <code>Schedule</code> has these 2 properties <code>StartDate</code> and <code>EndDate</code>, both of type <code>DateTime</code>.</p>
  <p>So, on this line, I'm getting the error &quot;Unable to marshal host object to interpreter space&quot;.</p>
  <p>Can anyone help me understand why and what it means?</p>
  <p>I tried to use <code>DateTime.Compare()</code> or changing <code>DateTime.Today</code> to <code>DateTime.Now</code>, nothing helps.</p>