public IDependency?GetResult(IDependenciesSnapshotFilter filter) { if (!_acceptedOrRejected) { throw new InvalidOperationException( $"Filter type {filter.GetType()} must either accept or reject the dependency."); } _acceptedOrRejected = false; return(_acceptedDependency); }
public bool GetResult(IDependenciesSnapshotFilter filter) { if (_acceptedOrRejected == null) { throw new InvalidOperationException( $"Filter type {filter.GetType()} must either accept or reject the dependency."); } bool?value = _acceptedOrRejected; _acceptedOrRejected = null; return(value.Value); }