/// <summary> /// Checks if an entity passes the filter. /// </summary> /// <param name="entity">The entity to check.</param> /// <returns>True if the entity passes the filter.</returns> public bool FilterPass(object entity) { if (this._Next != null) { switch (this._Operation) { case FilterOperation.And: return(_Filter.FilterPass(entity) && _Next.FilterPass(entity)); case FilterOperation.Or: return(_Filter.FilterPass(entity) || _Next.FilterPass(entity)); default: throw new NotImplementedException("Unknown filter operation " + _Operation); } } else { return(_Filter.FilterPass(entity)); } }