LINQ- Max in where condition

I have a class TaskWeekUI with this definition:

 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; }    } 

and I wrote this query :

 TaskWeekUI ti =  tis.First( t => t.PlanProgress > 0 && t.EndDate ==  tis.Where(p => p.PlanProgress != null && p.PlanProgress > 0).Max(w => w.EndDate));

Is this query is true? Can I write my query better than this?

11
задан Shayan 30 December 2010 в 11:07
поделиться