c# List集合的Find方法适用

CabinEntity为你定义的实体

CabinEntity existCabin = listCabins.Find(delegate(CabinEntity cabinE)
             {
                 return cabinE.AirCompany == modelPrice.AirCompany
                     && cabinE.Cabin == modelPrice.Cabin
                     && cabinE.ValidBeginTime <= modelPrice.TravelBeginTime && modelPrice.TravelBeginTime <= cabinE.ValidEndTime
                     && cabinE.ValidBeginTime <= modelPrice.TravelEndTime && modelPrice.TravelEndTime <= cabinE.ValidEndTime;
             });

上一篇:vim温馨提示


下一篇:深入理解Java反射