title: LINQ- Max in where condition
body: <p>I have a class TaskWeekUI with this  definition:</p>
  
  <pre><code> public class TaskWeekUI    {
     public Guid TaskWeekId { get; set; }
     public Guid TaskId { get; set; }
     public Guid WeekId { get; set; }
     public DateTime EndDate { get; set; }
     public string PersianEndDate { get; set; }
     public double PlanProgress { get; set; }
     public double ActualProgress { get; set; }    } 
  </code></pre>
  
  <p>and I wrote this query : </p>
  
  <pre><code> TaskWeekUI ti =  tis.First( t =&gt; t.PlanProgress &gt; 0 &amp;&amp; t.EndDate ==  tis.Where(p =&gt; p.PlanProgress != null &amp;&amp; p.PlanProgress &gt; 0).Max(w =&gt; w.EndDate));
  </code></pre>
  
  <p>Is this query is true? Can I write my    query better than this?</p>