public override void BeforeAddOrUpdate(
            ITargetFramework targetFramework,
            IDependency dependency,
            IReadOnlyDictionary <string, IProjectDependenciesSubTreeProvider> subTreeProviderByProviderType,
            IImmutableSet <string>?projectItemSpecs,
            AddDependencyContext context)
        {
            // TODO should this verify that the existing one is actually resolved?
            if (!dependency.Resolved && context.Contains(dependency.Id))
            {
                context.Reject();
                return;
            }

            context.Accept(dependency);
        }