private void InvokeReleasePipeline(int extensionIndex, ReleaseInvocation invocation) { if (extensionIndex >= releaseExtensions.Length) { invocation.ReturnValue = base.Release(invocation.Instance); return; } var nextIndex = extensionIndex + 1; invocation.SetProceedDelegate(() => InvokeReleasePipeline(nextIndex, invocation)); releaseExtensions[extensionIndex].Intercept(invocation); }