Skip to content

The name ApplyPolicy was already registered by another type #4606

Answered by PascalSenn
PascalSenn asked this question in Q&A
Discussion options

You must be logged in to vote

The solution:

Define a IDirectiveMergeHanlder:

 public class IgnoreAuthroizeDirectiveHanlder
        : IDirectiveMergeHandler
    {
        private readonly MergeDirectiveRuleDelegate _next;

        public IgnoreAuthroizeHanlder(MergeDirectiveRuleDelegate next)
        {
            _next = next;
        }

        public void Merge(
            ISchemaMergeContext context,
            IReadOnlyList<IDirectiveTypeInfo> directives)
        {
            IDirectiveTypeInfo? directive = directives.First();

            if (
                !directive.Definition.Name.Value.Equals(
                    "authorize",
                    StringComparison.InvariantCultureIgnoreCase))
            {

Replies: 1 comment 5 replies

Comment options

PascalSenn
Jan 3, 2022
Maintainer Author

You must be logged in to vote
5 replies
@martinmesserli
Comment options

@PascalSenn
Comment options

PascalSenn Jan 6, 2022
Maintainer Author

@martinmesserli
Comment options

@pratapkumarch
Comment options

@Christine-Schneidenwind
Comment options

Answer selected by PascalSenn
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants