public static TBuilder AddConstraint <TBuilder>( this TBuilder builder, IActionConstraintMetadata constraint) where TBuilder : IRouteBuilder <TBuilder> { return(builder.AddConstraint(sp => constraint)); }
private static void AddConstraint(IActionConstraintMetadata constraint, IList <SelectorModel> selectors) { for (var i = 0; i < selectors.Count; i++) { var selector = selectors[i]; selector.ActionConstraints.Add(constraint); } }
/// <summary> /// Creates a new <see cref="ActionConstraintItem"/>. /// </summary> /// <param name="metadata">The <see cref="IActionConstraintMetadata"/> instance.</param> public ActionConstraintItem(IActionConstraintMetadata metadata) { if (metadata == null) { throw new ArgumentNullException(nameof(metadata)); } Metadata = metadata; }
public ActionConstraintValues(IActionConstraintMetadata inner) { var constraint = inner as IActionConstraint; if (constraint != null) { IsConstraint = true; Order = constraint.Order; } if (inner is IActionConstraintFactory) { IsFactory = true; } ActionConstraintMetadataType = inner.GetType(); }
/// <summary> /// Creates a new <see cref="ActionConstraintItem"/>. /// </summary> /// <param name="metadata">The <see cref="IActionConstraintMetadata"/> instance.</param> public ActionConstraintItem([NotNull] IActionConstraintMetadata metadata) { Metadata = metadata; }
public ITypedRouteDetails WithActionConstraint(IActionConstraintMetadata constraint) { return(this.WithActionConstraints(constraint)); }