/// <summary>
        /// Constructs the IdLink for a particular <see cref="ResourceContext" /> and <see cref="ODataMetadataLevel" />.
        /// </summary>
        public virtual Uri BuildIdLink(ResourceContext instanceContext, ODataMetadataLevel metadataLevel)
        {
            if (instanceContext == null)
            {
                throw new ArgumentNullException(nameof(instanceContext));
            }

            if (_idLinkBuilder != null &&
                (metadataLevel == ODataMetadataLevel.Full ||
                 (metadataLevel == ODataMetadataLevel.Minimal && !_idLinkBuilder.FollowsConventions)))
            {
                return(_idLinkBuilder.Factory(instanceContext));
            }

            // Return null to let ODL decide when and how to build the id link.
            return(null);
        }
        /// <summary>
        /// Constructs a ReadLink URL for a particular <see cref="ResourceContext" /> and <see cref="ODataMetadataLevel" />.
        /// </summary>
        public virtual Uri BuildReadLink(ResourceContext instanceContext, ODataMetadataLevel metadataLevel, Uri editLink)
        {
            if (instanceContext == null)
            {
                throw new ArgumentNullException(nameof(instanceContext));
            }

            if (_readLinkBuilder != null &&
                (metadataLevel == ODataMetadataLevel.Full ||
                 (metadataLevel == ODataMetadataLevel.Minimal && !_readLinkBuilder.FollowsConventions)))
            {
                // read link is not the same as edit link. Generate if the client asked for it (full metadata modes) or
                // if the client cannot infer it (not follow conventions).
                return(_readLinkBuilder.Factory(instanceContext));
            }

            // Return null to let ODL decide when and how to build the read link.
            return(null);
        }