首先声名两个参数 为 string StartDate,EndDate;然后判断参数是否为空,PatchDates为日期判断
if (StartDate != “” && EndDate != “”)
{
DateTime startDate = Convert.ToDateTime(StartDate);转换为日期格式
DateTime endDate = Convert.ToDateTime(EndDate);
listResult = listResult.Where(m => m.PatchDates >= startDate && m.PatchDates= <endDate).ToList();
}