Пример #1
0
        /// <summary>
        /// Determines whether the specified action should be explored for the indicated API version.
        /// </summary>
        /// <param name="actionDescriptor">The <see cref="ActionDescriptor">action</see> to evaluate.</param>
        /// <param name="apiVersion">The <see cref="ApiVersion">API version</see> for action being explored.</param>
        /// <returns>True if the action should be explored; otherwise, false.</returns>
        protected virtual bool ShouldExploreAction(ActionDescriptor actionDescriptor, ApiVersion apiVersion)
        {
            Arg.NotNull(actionDescriptor, nameof(actionDescriptor));
            Arg.NotNull(apiVersion, nameof(actionDescriptor));

            return(actionDescriptor.IsMappedTo(apiVersion));
        }
Пример #2
0
        private static bool ActionIsSatisfiedBy(ActionDescriptor action, ApiVersionModel model, ApiVersion version, ICollection <ActionDescriptor> implicitMatches)
        {
            Contract.Requires(action != null);
            Contract.Requires(implicitMatches != null);

            if (model == null)
            {
                return(false);
            }

            if (action.IsMappedTo(version))
            {
                return(true);
            }

            if (action.IsImplicitlyMappedTo(version))
            {
                implicitMatches.Add(action);
            }

            return(false);
        }
 /// <summary>
 /// Determines whether the specified action should be explored for the indicated API version.
 /// </summary>
 /// <param name="actionDescriptor">The <see cref="ActionDescriptor">action</see> to evaluate.</param>
 /// <param name="apiVersion">The <see cref="ApiVersion">API version</see> for action being explored.</param>
 /// <returns>True if the action should be explored; otherwise, false.</returns>
 protected virtual bool ShouldExploreAction(ActionDescriptor actionDescriptor, ApiVersion apiVersion) => actionDescriptor.IsMappedTo(apiVersion);