public (IReadOnlyList <InvokeDependencyKey> PreActionKeys, IReadOnlyList <InvokeDependencyKey> PostActionKeys) FindKeys(MethodInfo methodInfo) { var approxKeys = InvokeDependencyKey.ParseApproximateKeys(methodInfo); IEnumerable <InvokeDependencyKey> preActionKeys = null; if (_preActions.Keys.Count > 0) { preActionKeys = approxKeys.Intersect(_preActions.Keys); } if (_postActions.Keys.Count > 0) { return(preActionKeys?.AsReadOnlyList(), approxKeys.Intersect(_postActions.Keys)?.AsReadOnlyList()); } return(preActionKeys?.AsReadOnlyList(), null); }
public bool TryRemovePostActions(InvokeDependencyKey key, out IEnumerable <Action <TInterface, object> > postActions) => _postActions.TryRemove(key, out postActions);
public bool TryRemovePreActions(InvokeDependencyKey key, out IEnumerable <Action <TInterface> > preActions) => _preActions.TryRemove(key, out preActions);
public void AddPostActions(InvokeDependencyKey key, params Action <TInterface, object>[] postActions) => _postActions.AddOrUpdate(key, postActions, (key, value) => value.Concat(postActions));
public void AddPreActions(InvokeDependencyKey key, params Action <TInterface>[] preActions) => _preActions.AddOrUpdate(key, preActions, (key, value) => value.Concat(preActions));