title: Match dates in Linq, C#, SQL
body: <p>I am using the repository pattern to query SQL to get a record based on a date passed in via a web api.  The query string is date=2014-09-16, for example.  When my repository receives this date, the time is automatically set to 12:00:00 since one wasn't passed.  I am only interested in matching the date in the database like this:</p>
  
  <pre><code>public IQueryable&lt;Instance&gt; GetInstances(DateTime date) {
          return DBContext.Instances.Where(x =&gt; x.StartDateTime == date).OrderBy(x =&gt; x.StartDateTime).AsQueryable();
      }
  </code></pre>
  
  <p>The problem is that no match is found since the records in the db are not a full match because of the time portion even though records exist for this date.  What is the best way to get a match in the above example?</p>