Hello
Use Full
DateTime
For example:
You have a List of Reservation.
List<reservation> ReservationList;
This is the Reservation class:
public class Reservation
{
public Doctor Doctor {get; set;}
public DateTime GettingTime {get; set;}
public DateTime ExpiredTime {get; set;}
}
public bool IsReserved(Doctor doctor, DateTime startDateTime, DateTime expiredDatetime, List<reservation> list)
{
return (list.Where(r=>r.Doctor == doctor && startDateTime>=r.GettingTime && startDateTime<=r.ExpiredTime && expiredDatetime<r.GettingTime).Count()==0) true:false;
}