public bool Intersects(BookPeriod other) { return other.BeginAt <= BeginAt && BeginAt < other.EndAt || other.BeginAt < EndAt && EndAt <= other.EndAt; }
public void Execute() { var period = new BookPeriod(_request.BeginAt, _request.EndAt); _booking = new Booking(_request.PersonName, period); _register.TryBook(_request.RoomNumber, _booking); }
public bool Equals(BookPeriod other) { return BeginAt.Equals(other.BeginAt) && EndAt.Equals(other.EndAt); }