private IConflictCheck BuildCheckChain(IConflictCheck olc) { IConflictCheck handler = olc; handler.SetNext(new NullCheck()); return(handler); }
public ConflictCheck(ICalendarEventRepository <CalendarEvent> repository , [Optional] IOverlappingCheck olc) { _events = repository.GetAll(); // The idea is that, there will be many rule checks (my previous projects have over 30 rules) as well as many events (aka 1000+), so we do not want to connect to database multiple times IConflictCheck handler = BuildCheckChain(olc); handler.SetNext(new NullCheck()); // Null check always the last one _chain = new ConflictCheckChain(handler); }
public ConflictCheckChain(IConflictCheck _handler) { handler = _handler; }
public IConflictCheck SetNext(IConflictCheck conflictCheck) { _nextCheck = conflictCheck; return(conflictCheck); }