C#Linq 2date之间的date

我试图让我的linq语句让我在两个date之间的所有logging,我不太清楚我需要改变,以使其工作: (a.Start >= startDate && endDate)

 var appointmentNoShow = from a in appointments from p in properties from c in clients where a.Id == p.OID && (a.Start.Date >= startDate.Date && endDate) 

只要改变它

 var appointmentNoShow = from a in appointments from p in properties from c in clients where a.Id == p.OID && (a.Start.Date >= startDate.Date && a.Start.Date <= endDate) 
 var appointmentNoShow = from a in appointments from p in properties from c in clients where a.Id == p.OID where a.Start.Date >= startDate.Date where a.Start.Date <= endDate.Date 
 var QueryNew = _context.Appointments.Include(x => x.Employee).Include(x => x.city).Where(x => x.CreatedOn >= FromDate).Where(x => x.CreatedOn <= ToDate).Where(x => x.IsActive == true).ToList(); 
  public List<tbltask> gettaskssdata(int? c, int? userid, string a, string StartDate, string EndDate, int? ProjectID, int? statusid) { List<tbltask> tbtask = new List<tbltask>(); DateTime sdate = (StartDate != "") ? Convert.ToDateTime(StartDate).Date : new DateTime(); DateTime edate = (EndDate != "") ? Convert.ToDateTime(EndDate).Date : new DateTime(); tbtask = entity.tbltasks.Include(x => x.tblproject).Include(x => x.tbUser). Where(x => x.tblproject.company_id == c && (ProjectID == 0 || ProjectID == x.tblproject.ProjectId) && (statusid == 0 || statusid == x.tblstatu.StatusId) && (a == "" || (x.TaskName.Contains(a) || x.tbUser.User_name.Contains(a))) && ((StartDate == "" && EndDate == "") || ((x.StartDate >= sdate && x.EndDate <= edate)))).ToList(); return tbtask; }