示例#1
0
 /// <summary>
 /// Returns a value indicating whether the provided action maps to the specified API version.
 /// </summary>
 /// <param name="action">The <see cref="HttpActionDescriptor">action</see> to evaluate.</param>
 /// <param name="apiVersion">The <see cref="ApiVersion">API version</see> to test the mapping for.</param>
 /// <returns>True if the <paramref name="action"/> explicitly or implicitly maps to the specified
 /// <paramref name="apiVersion">API version</paramref>; otherwise, false.</returns>
 public static bool IsMappedTo(this HttpActionDescriptor action, ApiVersion apiVersion) => action.MappingTo(apiVersion) > None;
示例#2
0
 /// <summary>
 /// Returns a value indicating whether the provided action maps to the specified API version.
 /// </summary>
 /// <param name="action">The <see cref="HttpActionDescriptor">action</see> to evaluate.</param>
 /// <param name="apiVersion">The <see cref="ApiVersion">API version</see> to test the mapping for.</param>
 /// <returns>True if the <paramref name="action"/> explicitly or implicitly maps to the specified
 /// <paramref name="apiVersion">API version</paramref>; otherwise, false.</returns>
 public static bool IsMappedTo(this HttpActionDescriptor action, ApiVersion apiVersion)
 {
     Arg.NotNull(action, nameof(action));
     return(action.MappingTo(apiVersion) > None);
 }