Пример #1
0
        protected override IReadOnlyCollection <ResourceFieldAttribute> OnResolveFieldChain(string path, FieldChainRequirements chainRequirements)
        {
            if (chainRequirements == FieldChainRequirements.EndsInToMany)
            {
                // The mismatch here (ends-in-to-many being interpreted as entire-chain-must-be-to-many) is intentional.
                return(ChainResolver.ResolveToManyChain(_resourceContextInScope, path, _validateSingleFieldCallback));
            }

            if (chainRequirements == FieldChainRequirements.IsRelationship)
            {
                return(ChainResolver.ResolveRelationshipChain(_resourceContextInScope, path, _validateSingleFieldCallback));
            }

            throw new InvalidOperationException($"Unexpected combination of chain requirement flags '{chainRequirements}'.");
        }
 protected override IReadOnlyCollection <ResourceFieldAttribute> OnResolveFieldChain(string path, FieldChainRequirements chainRequirements)
 {
     return(ChainResolver.ResolveToManyChain(_resourceContextInScope, path, _validateSingleFieldCallback));
 }