// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System;
using Microsoft.AspNetCore.Routing.Patterns;
namespace Microsoft.AspNetCore.Routing.Template
{
///
/// The parsed representation of an inline constraint in a route parameter.
///
public class InlineConstraint
{
///
/// Creates a new .
///
/// The constraint text.
public InlineConstraint(string constraint)
{
if (constraint == null)
{
throw new ArgumentNullException(nameof(constraint));
}
Constraint = constraint;
}
public InlineConstraint(RoutePatternConstraintReference other)
{
if (other == null)
{
throw new ArgumentNullException(nameof(other));
}
Constraint = other.Content;
}
///
/// Gets the constraint text.
///
public string Constraint { get; }
}
}