Delete trailing whitespace
- #EngineeringDay - Total replaced: 105 Matching files: 44 in *.cs files - Total replaced: 27 Matching files: 1 in all other files
This commit is contained in:
parent
91c3a550f1
commit
1a101d7815
|
|
@ -14,7 +14,7 @@ namespace Microsoft.AspNet.Routing.Constraints
|
||||||
public class BoolRouteConstraint : IRouteConstraint
|
public class BoolRouteConstraint : IRouteConstraint
|
||||||
{
|
{
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public bool Match([NotNull] HttpContext httpContext,
|
public bool Match([NotNull] HttpContext httpContext,
|
||||||
[NotNull] IRouter route,
|
[NotNull] IRouter route,
|
||||||
[NotNull] string routeKey,
|
[NotNull] string routeKey,
|
||||||
[NotNull] IDictionary<string, object> values,
|
[NotNull] IDictionary<string, object> values,
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,7 @@ namespace Microsoft.AspNet.Routing
|
||||||
public IEnumerable<IRouteConstraint> Constraints { get; private set; }
|
public IEnumerable<IRouteConstraint> Constraints { get; private set; }
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public bool Match([NotNull] HttpContext httpContext,
|
public bool Match([NotNull] HttpContext httpContext,
|
||||||
[NotNull] IRouter route,
|
[NotNull] IRouter route,
|
||||||
[NotNull] string routeKey,
|
[NotNull] string routeKey,
|
||||||
[NotNull] IDictionary<string, object> values,
|
[NotNull] IDictionary<string, object> values,
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@ namespace Microsoft.AspNet.Routing.Constraints
|
||||||
/// Constrains a route parameter to represent only <see cref="DateTime"/> values.
|
/// Constrains a route parameter to represent only <see cref="DateTime"/> values.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <remarks>
|
/// <remarks>
|
||||||
/// This constraint tries to parse strings by using all of the formats returned by the
|
/// This constraint tries to parse strings by using all of the formats returned by the
|
||||||
/// CultureInfo.InvariantCulture.DateTimeFormat.GetAllDateTimePatterns() method.
|
/// CultureInfo.InvariantCulture.DateTimeFormat.GetAllDateTimePatterns() method.
|
||||||
/// For a sample on how to list all formats which are considered, please visit
|
/// For a sample on how to list all formats which are considered, please visit
|
||||||
/// http://msdn.microsoft.com/en-us/library/aszyst2c(v=vs.110).aspx
|
/// http://msdn.microsoft.com/en-us/library/aszyst2c(v=vs.110).aspx
|
||||||
|
|
@ -20,7 +20,7 @@ namespace Microsoft.AspNet.Routing.Constraints
|
||||||
public class DateTimeRouteConstraint : IRouteConstraint
|
public class DateTimeRouteConstraint : IRouteConstraint
|
||||||
{
|
{
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public bool Match([NotNull] HttpContext httpContext,
|
public bool Match([NotNull] HttpContext httpContext,
|
||||||
[NotNull] IRouter route,
|
[NotNull] IRouter route,
|
||||||
[NotNull] string routeKey,
|
[NotNull] string routeKey,
|
||||||
[NotNull] IDictionary<string, object> values,
|
[NotNull] IDictionary<string, object> values,
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,7 @@ namespace Microsoft.AspNet.Routing.Constraints
|
||||||
public class DecimalRouteConstraint : IRouteConstraint
|
public class DecimalRouteConstraint : IRouteConstraint
|
||||||
{
|
{
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public bool Match([NotNull] HttpContext httpContext,
|
public bool Match([NotNull] HttpContext httpContext,
|
||||||
[NotNull] IRouter route,
|
[NotNull] IRouter route,
|
||||||
[NotNull] string routeKey,
|
[NotNull] string routeKey,
|
||||||
[NotNull] IDictionary<string, object> values,
|
[NotNull] IDictionary<string, object> values,
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,7 @@ namespace Microsoft.AspNet.Routing.Constraints
|
||||||
public class DoubleRouteConstraint : IRouteConstraint
|
public class DoubleRouteConstraint : IRouteConstraint
|
||||||
{
|
{
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public bool Match([NotNull] HttpContext httpContext,
|
public bool Match([NotNull] HttpContext httpContext,
|
||||||
[NotNull] IRouter route,
|
[NotNull] IRouter route,
|
||||||
[NotNull] string routeKey,
|
[NotNull] string routeKey,
|
||||||
[NotNull] IDictionary<string, object> values,
|
[NotNull] IDictionary<string, object> values,
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,7 @@ namespace Microsoft.AspNet.Routing.Constraints
|
||||||
public class FloatRouteConstraint : IRouteConstraint
|
public class FloatRouteConstraint : IRouteConstraint
|
||||||
{
|
{
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public bool Match([NotNull] HttpContext httpContext,
|
public bool Match([NotNull] HttpContext httpContext,
|
||||||
[NotNull] IRouter route,
|
[NotNull] IRouter route,
|
||||||
[NotNull] string routeKey,
|
[NotNull] string routeKey,
|
||||||
[NotNull] IDictionary<string, object> values,
|
[NotNull] IDictionary<string, object> values,
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,7 @@ namespace Microsoft.AspNet.Routing.Constraints
|
||||||
public class GuidRouteConstraint : IRouteConstraint
|
public class GuidRouteConstraint : IRouteConstraint
|
||||||
{
|
{
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public bool Match([NotNull] HttpContext httpContext,
|
public bool Match([NotNull] HttpContext httpContext,
|
||||||
[NotNull] IRouter route,
|
[NotNull] IRouter route,
|
||||||
[NotNull] string routeKey,
|
[NotNull] string routeKey,
|
||||||
[NotNull] IDictionary<string, object> values,
|
[NotNull] IDictionary<string, object> values,
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,7 @@ namespace Microsoft.AspNet.Routing.Constraints
|
||||||
public class IntRouteConstraint : IRouteConstraint
|
public class IntRouteConstraint : IRouteConstraint
|
||||||
{
|
{
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public bool Match([NotNull] HttpContext httpContext,
|
public bool Match([NotNull] HttpContext httpContext,
|
||||||
[NotNull] IRouter route,
|
[NotNull] IRouter route,
|
||||||
[NotNull] string routeKey,
|
[NotNull] string routeKey,
|
||||||
[NotNull] IDictionary<string, object> values,
|
[NotNull] IDictionary<string, object> values,
|
||||||
|
|
|
||||||
|
|
@ -51,7 +51,7 @@ namespace Microsoft.AspNet.Routing.Constraints
|
||||||
|
|
||||||
if (minLength > maxLength)
|
if (minLength > maxLength)
|
||||||
{
|
{
|
||||||
var errorMessage =
|
var errorMessage =
|
||||||
Resources.FormatRangeConstraint_MinShouldBeLessThanOrEqualToMax("minLength", "maxLength");
|
Resources.FormatRangeConstraint_MinShouldBeLessThanOrEqualToMax("minLength", "maxLength");
|
||||||
throw new ArgumentOutOfRangeException("minLength", minLength, errorMessage);
|
throw new ArgumentOutOfRangeException("minLength", minLength, errorMessage);
|
||||||
}
|
}
|
||||||
|
|
@ -71,7 +71,7 @@ namespace Microsoft.AspNet.Routing.Constraints
|
||||||
public int MaxLength { get; private set; }
|
public int MaxLength { get; private set; }
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public bool Match([NotNull] HttpContext httpContext,
|
public bool Match([NotNull] HttpContext httpContext,
|
||||||
[NotNull] IRouter route,
|
[NotNull] IRouter route,
|
||||||
[NotNull] string routeKey,
|
[NotNull] string routeKey,
|
||||||
[NotNull] IDictionary<string, object> values,
|
[NotNull] IDictionary<string, object> values,
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,7 @@ namespace Microsoft.AspNet.Routing.Constraints
|
||||||
public class LongRouteConstraint : IRouteConstraint
|
public class LongRouteConstraint : IRouteConstraint
|
||||||
{
|
{
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public bool Match([NotNull] HttpContext httpContext,
|
public bool Match([NotNull] HttpContext httpContext,
|
||||||
[NotNull] IRouter route,
|
[NotNull] IRouter route,
|
||||||
[NotNull] string routeKey,
|
[NotNull] string routeKey,
|
||||||
[NotNull] IDictionary<string, object> values,
|
[NotNull] IDictionary<string, object> values,
|
||||||
|
|
|
||||||
|
|
@ -34,7 +34,7 @@ namespace Microsoft.AspNet.Routing.Constraints
|
||||||
public int MaxLength { get; private set; }
|
public int MaxLength { get; private set; }
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public bool Match([NotNull] HttpContext httpContext,
|
public bool Match([NotNull] HttpContext httpContext,
|
||||||
[NotNull] IRouter route,
|
[NotNull] IRouter route,
|
||||||
[NotNull] string routeKey,
|
[NotNull] string routeKey,
|
||||||
[NotNull] IDictionary<string, object> values,
|
[NotNull] IDictionary<string, object> values,
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,7 @@ namespace Microsoft.AspNet.Routing.Constraints
|
||||||
public long Max { get; private set; }
|
public long Max { get; private set; }
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public bool Match([NotNull] HttpContext httpContext,
|
public bool Match([NotNull] HttpContext httpContext,
|
||||||
[NotNull] IRouter route,
|
[NotNull] IRouter route,
|
||||||
[NotNull] string routeKey,
|
[NotNull] string routeKey,
|
||||||
[NotNull] IDictionary<string, object> values,
|
[NotNull] IDictionary<string, object> values,
|
||||||
|
|
|
||||||
|
|
@ -34,7 +34,7 @@ namespace Microsoft.AspNet.Routing.Constraints
|
||||||
public int MinLength { get; private set; }
|
public int MinLength { get; private set; }
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public bool Match([NotNull] HttpContext httpContext,
|
public bool Match([NotNull] HttpContext httpContext,
|
||||||
[NotNull] IRouter route,
|
[NotNull] IRouter route,
|
||||||
[NotNull] string routeKey,
|
[NotNull] string routeKey,
|
||||||
[NotNull] IDictionary<string, object> values,
|
[NotNull] IDictionary<string, object> values,
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,7 @@ namespace Microsoft.AspNet.Routing.Constraints
|
||||||
public long Min { get; private set; }
|
public long Min { get; private set; }
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public bool Match([NotNull] HttpContext httpContext,
|
public bool Match([NotNull] HttpContext httpContext,
|
||||||
[NotNull] IRouter route,
|
[NotNull] IRouter route,
|
||||||
[NotNull] string routeKey,
|
[NotNull] string routeKey,
|
||||||
[NotNull] IDictionary<string, object> values,
|
[NotNull] IDictionary<string, object> values,
|
||||||
|
|
|
||||||
|
|
@ -42,7 +42,7 @@ namespace Microsoft.AspNet.Routing.Constraints
|
||||||
public long Max { get; private set; }
|
public long Max { get; private set; }
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public bool Match([NotNull] HttpContext httpContext,
|
public bool Match([NotNull] HttpContext httpContext,
|
||||||
[NotNull] IRouter route,
|
[NotNull] IRouter route,
|
||||||
[NotNull] string routeKey,
|
[NotNull] string routeKey,
|
||||||
[NotNull] IDictionary<string, object> values,
|
[NotNull] IDictionary<string, object> values,
|
||||||
|
|
|
||||||
|
|
@ -12,17 +12,17 @@ namespace Microsoft.AspNet.Routing.Constraints
|
||||||
/// Constraints a route parameter that must have a value.
|
/// Constraints a route parameter that must have a value.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <remarks>
|
/// <remarks>
|
||||||
/// This constraint is primarily used to enforce that a non-parameter value is present during
|
/// This constraint is primarily used to enforce that a non-parameter value is present during
|
||||||
/// URL generation.
|
/// URL generation.
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
public class RequiredRouteConstraint : IRouteConstraint
|
public class RequiredRouteConstraint : IRouteConstraint
|
||||||
{
|
{
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public bool Match(
|
public bool Match(
|
||||||
[NotNull]HttpContext httpContext,
|
[NotNull]HttpContext httpContext,
|
||||||
[NotNull]IRouter route,
|
[NotNull]IRouter route,
|
||||||
[NotNull]string routeKey,
|
[NotNull]string routeKey,
|
||||||
[NotNull]IDictionary<string, object> values,
|
[NotNull]IDictionary<string, object> values,
|
||||||
RouteDirection routeDirection)
|
RouteDirection routeDirection)
|
||||||
{
|
{
|
||||||
object value;
|
object value;
|
||||||
|
|
|
||||||
|
|
@ -47,7 +47,7 @@ namespace Microsoft.AspNet.Routing
|
||||||
}
|
}
|
||||||
|
|
||||||
var parameterName = parameterMatch.Groups["parameterName"].Value;
|
var parameterName = parameterMatch.Groups["parameterName"].Value;
|
||||||
|
|
||||||
// Add the default value if present
|
// Add the default value if present
|
||||||
var defaultValueGroup = parameterMatch.Groups["defaultValue"];
|
var defaultValueGroup = parameterMatch.Groups["defaultValue"];
|
||||||
var defaultValue = GetDefaultValue(defaultValueGroup);
|
var defaultValue = GetDefaultValue(defaultValueGroup);
|
||||||
|
|
@ -55,12 +55,12 @@ namespace Microsoft.AspNet.Routing
|
||||||
// Register inline constraints if present
|
// Register inline constraints if present
|
||||||
var constraintGroup = parameterMatch.Groups["constraint"];
|
var constraintGroup = parameterMatch.Groups["constraint"];
|
||||||
var inlineConstraints = GetInlineConstraints(constraintGroup);
|
var inlineConstraints = GetInlineConstraints(constraintGroup);
|
||||||
|
|
||||||
return TemplatePart.CreateParameter(parameterName,
|
return TemplatePart.CreateParameter(parameterName,
|
||||||
isCatchAll,
|
isCatchAll,
|
||||||
isOptional,
|
isOptional,
|
||||||
defaultValue,
|
defaultValue,
|
||||||
inlineConstraints);
|
inlineConstraints);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static string GetDefaultValue(Group defaultValueGroup)
|
private static string GetDefaultValue(Group defaultValueGroup)
|
||||||
|
|
|
||||||
|
|
@ -9,9 +9,9 @@ namespace Microsoft.AspNet.Routing.Logging.Internal
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// A formatter for use with <see cref="Microsoft.Framework.Logging.ILogger.WriteCore(
|
/// A formatter for use with <see cref="Microsoft.Framework.Logging.ILogger.WriteCore(
|
||||||
/// Framework.Logging.LogLevel,
|
/// Framework.Logging.LogLevel,
|
||||||
/// int,
|
/// int,
|
||||||
/// object,
|
/// object,
|
||||||
/// Exception, Func{object, Exception, string})"/>.
|
/// Exception, Func{object, Exception, string})"/>.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static string Formatter(object o, Exception e)
|
public static string Formatter(object o, Exception e)
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@ using System.Text;
|
||||||
namespace Microsoft.AspNet.Routing.Logging
|
namespace Microsoft.AspNet.Routing.Logging
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Describes the state of
|
/// Describes the state of
|
||||||
/// <see cref="Microsoft.AspNet.Routing.RouteCollection.RouteAsync(RouteContext)"/>.
|
/// <see cref="Microsoft.AspNet.Routing.RouteCollection.RouteAsync(RouteContext)"/>.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class RouteCollectionRouteAsyncValues
|
public class RouteCollectionRouteAsyncValues
|
||||||
|
|
|
||||||
|
|
@ -7,11 +7,11 @@ namespace Microsoft.AspNet.Routing.Logging
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Describes the state of <see cref="RouteConstraintMatcher.Match(
|
/// Describes the state of <see cref="RouteConstraintMatcher.Match(
|
||||||
/// System.Collections.Generic.IDictionary{string, IRouteConstraint},
|
/// System.Collections.Generic.IDictionary{string, IRouteConstraint},
|
||||||
/// System.Collections.Generic.IDictionary{string, object},
|
/// System.Collections.Generic.IDictionary{string, object},
|
||||||
/// Http.HttpContext,
|
/// Http.HttpContext,
|
||||||
/// IRouter,
|
/// IRouter,
|
||||||
/// RouteDirection,
|
/// RouteDirection,
|
||||||
/// Framework.Logging.ILogger)"/>.
|
/// Framework.Logging.ILogger)"/>.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class RouteConstraintMatcherMatchValues
|
public class RouteConstraintMatcherMatchValues
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@ using System.Text;
|
||||||
namespace Microsoft.AspNet.Routing.Logging
|
namespace Microsoft.AspNet.Routing.Logging
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Describes the state of
|
/// Describes the state of
|
||||||
/// <see cref="Microsoft.AspNet.Builder.RouterMiddleware.Invoke(Http.HttpContext)"/>.
|
/// <see cref="Microsoft.AspNet.Builder.RouterMiddleware.Invoke(Http.HttpContext)"/>.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class RouterMiddlewareInvokeValues
|
public class RouterMiddlewareInvokeValues
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@ using System.Text;
|
||||||
namespace Microsoft.AspNet.Routing.Logging
|
namespace Microsoft.AspNet.Routing.Logging
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Describes the state of
|
/// Describes the state of
|
||||||
/// <see cref="Microsoft.AspNet.Routing.Template.TemplateRoute.RouteAsync(RouteContext)"/>.
|
/// <see cref="Microsoft.AspNet.Routing.Template.TemplateRoute.RouteAsync(RouteContext)"/>.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class TemplateRouteRouteAsyncValues
|
public class TemplateRouteRouteAsyncValues
|
||||||
|
|
|
||||||
|
|
@ -1,17 +1,17 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<root>
|
<root>
|
||||||
<!--
|
<!--
|
||||||
Microsoft ResX Schema
|
Microsoft ResX Schema
|
||||||
|
|
||||||
Version 2.0
|
Version 2.0
|
||||||
|
|
||||||
The primary goals of this format is to allow a simple XML format
|
The primary goals of this format is to allow a simple XML format
|
||||||
that is mostly human readable. The generation and parsing of the
|
that is mostly human readable. The generation and parsing of the
|
||||||
various data types are done through the TypeConverter classes
|
various data types are done through the TypeConverter classes
|
||||||
associated with the data types.
|
associated with the data types.
|
||||||
|
|
||||||
Example:
|
Example:
|
||||||
|
|
||||||
... ado.net/XML headers & schema ...
|
... ado.net/XML headers & schema ...
|
||||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||||
<resheader name="version">2.0</resheader>
|
<resheader name="version">2.0</resheader>
|
||||||
|
|
@ -26,36 +26,36 @@
|
||||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||||
<comment>This is a comment</comment>
|
<comment>This is a comment</comment>
|
||||||
</data>
|
</data>
|
||||||
|
|
||||||
There are any number of "resheader" rows that contain simple
|
There are any number of "resheader" rows that contain simple
|
||||||
name/value pairs.
|
name/value pairs.
|
||||||
|
|
||||||
Each data row contains a name, and value. The row also contains a
|
Each data row contains a name, and value. The row also contains a
|
||||||
type or mimetype. Type corresponds to a .NET class that support
|
type or mimetype. Type corresponds to a .NET class that support
|
||||||
text/value conversion through the TypeConverter architecture.
|
text/value conversion through the TypeConverter architecture.
|
||||||
Classes that don't support this are serialized and stored with the
|
Classes that don't support this are serialized and stored with the
|
||||||
mimetype set.
|
mimetype set.
|
||||||
|
|
||||||
The mimetype is used for serialized objects, and tells the
|
The mimetype is used for serialized objects, and tells the
|
||||||
ResXResourceReader how to depersist the object. This is currently not
|
ResXResourceReader how to depersist the object. This is currently not
|
||||||
extensible. For a given mimetype the value must be set accordingly:
|
extensible. For a given mimetype the value must be set accordingly:
|
||||||
|
|
||||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||||
that the ResXResourceWriter will generate, however the reader can
|
that the ResXResourceWriter will generate, however the reader can
|
||||||
read any of the formats listed below.
|
read any of the formats listed below.
|
||||||
|
|
||||||
mimetype: application/x-microsoft.net.object.binary.base64
|
mimetype: application/x-microsoft.net.object.binary.base64
|
||||||
value : The object must be serialized with
|
value : The object must be serialized with
|
||||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||||
: and then encoded with base64 encoding.
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
mimetype: application/x-microsoft.net.object.soap.base64
|
mimetype: application/x-microsoft.net.object.soap.base64
|
||||||
value : The object must be serialized with
|
value : The object must be serialized with
|
||||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||||
: and then encoded with base64 encoding.
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||||
value : The object must be serialized into a byte array
|
value : The object must be serialized into a byte array
|
||||||
: using a System.ComponentModel.TypeConverter
|
: using a System.ComponentModel.TypeConverter
|
||||||
: and then encoded with base64 encoding.
|
: and then encoded with base64 encoding.
|
||||||
-->
|
-->
|
||||||
|
|
|
||||||
|
|
@ -68,7 +68,7 @@ namespace Microsoft.AspNet.Routing
|
||||||
{
|
{
|
||||||
return dictionary;
|
return dictionary;
|
||||||
}
|
}
|
||||||
|
|
||||||
return new RouteValueDictionary(value);
|
return new RouteValueDictionary(value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -70,7 +70,7 @@ namespace Microsoft.AspNet.Routing
|
||||||
/// </param>
|
/// </param>
|
||||||
/// <remarks>
|
/// <remarks>
|
||||||
/// If the <paramref name="value"/> is a string, it will be converted to a <see cref="RegexRouteConstraint"/>.
|
/// If the <paramref name="value"/> is a string, it will be converted to a <see cref="RegexRouteConstraint"/>.
|
||||||
///
|
///
|
||||||
/// For example, the string <code>Product[0-9]+</code> will be converted to the regular expression
|
/// For example, the string <code>Product[0-9]+</code> will be converted to the regular expression
|
||||||
/// <code>^(Product[0-9]+)</code>. See <see cref="System.Text.RegularExpressions.Regex"/> for more details.
|
/// <code>^(Product[0-9]+)</code>. See <see cref="System.Text.RegularExpressions.Regex"/> for more details.
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
|
|
|
||||||
|
|
@ -54,12 +54,12 @@ namespace Microsoft.AspNet.Routing
|
||||||
{
|
{
|
||||||
var type = obj.GetType();
|
var type = obj.GetType();
|
||||||
var allProperties = type.GetRuntimeProperties();
|
var allProperties = type.GetRuntimeProperties();
|
||||||
|
|
||||||
// This is done to support 'new' properties that hide a property on a base class
|
// This is done to support 'new' properties that hide a property on a base class
|
||||||
var orderedByDeclaringType = allProperties.OrderBy(p => p.DeclaringType == type ? 0 : 1);
|
var orderedByDeclaringType = allProperties.OrderBy(p => p.DeclaringType == type ? 0 : 1);
|
||||||
foreach (var property in orderedByDeclaringType)
|
foreach (var property in orderedByDeclaringType)
|
||||||
{
|
{
|
||||||
if (property.GetMethod != null &&
|
if (property.GetMethod != null &&
|
||||||
property.GetMethod.IsPublic &&
|
property.GetMethod.IsPublic &&
|
||||||
!property.GetMethod.IsStatic &&
|
!property.GetMethod.IsStatic &&
|
||||||
property.GetIndexParameters().Length == 0)
|
property.GetIndexParameters().Length == 0)
|
||||||
|
|
@ -210,7 +210,7 @@ namespace Microsoft.AspNet.Routing
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
void ICollection<KeyValuePair<string, object>>.CopyTo(
|
void ICollection<KeyValuePair<string, object>>.CopyTo(
|
||||||
[NotNull] KeyValuePair<string, object>[] array,
|
[NotNull] KeyValuePair<string, object>[] array,
|
||||||
int arrayIndex)
|
int arrayIndex)
|
||||||
{
|
{
|
||||||
((ICollection<KeyValuePair<string, object>>)_dictionary).CopyTo(array, arrayIndex);
|
((ICollection<KeyValuePair<string, object>>)_dictionary).CopyTo(array, arrayIndex);
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,7 @@ namespace Microsoft.AspNet.Builder
|
||||||
public RouterMiddleware(
|
public RouterMiddleware(
|
||||||
RequestDelegate next,
|
RequestDelegate next,
|
||||||
IServiceProvider services,
|
IServiceProvider services,
|
||||||
ILoggerFactory loggerFactory,
|
ILoggerFactory loggerFactory,
|
||||||
IRouter router)
|
IRouter router)
|
||||||
{
|
{
|
||||||
_next = next;
|
_next = next;
|
||||||
|
|
|
||||||
|
|
@ -341,7 +341,7 @@ namespace Microsoft.AspNet.Routing.Template
|
||||||
private readonly RouteValueDictionary _filters;
|
private readonly RouteValueDictionary _filters;
|
||||||
|
|
||||||
public TemplateBindingContext(
|
public TemplateBindingContext(
|
||||||
IReadOnlyDictionary<string, object> defaults,
|
IReadOnlyDictionary<string, object> defaults,
|
||||||
IDictionary<string, object> values)
|
IDictionary<string, object> values)
|
||||||
{
|
{
|
||||||
if (values == null)
|
if (values == null)
|
||||||
|
|
|
||||||
|
|
@ -95,7 +95,7 @@ namespace Microsoft.AspNet.Routing.Template
|
||||||
}
|
}
|
||||||
else if (part.IsOptional)
|
else if (part.IsOptional)
|
||||||
{
|
{
|
||||||
// This is optional (with no default value)
|
// This is optional (with no default value)
|
||||||
// - there's nothing to capture here, so just move on.
|
// - there's nothing to capture here, so just move on.
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
|
||||||
|
|
@ -176,8 +176,8 @@ namespace Microsoft.AspNet.Routing.Template
|
||||||
|
|
||||||
var rawParameter = context.Capture();
|
var rawParameter = context.Capture();
|
||||||
|
|
||||||
// At this point, we need to parse the raw name for inline constraint,
|
// At this point, we need to parse the raw name for inline constraint,
|
||||||
// default values and optional parameters.
|
// default values and optional parameters.
|
||||||
var templatePart = InlineRouteParameterParser.ParseRouteParameter(rawParameter);
|
var templatePart = InlineRouteParameterParser.ParseRouteParameter(rawParameter);
|
||||||
|
|
||||||
if (templatePart.IsCatchAll && templatePart.IsOptional)
|
if (templatePart.IsCatchAll && templatePart.IsOptional)
|
||||||
|
|
@ -189,14 +189,14 @@ namespace Microsoft.AspNet.Routing.Template
|
||||||
if (templatePart.IsOptional && templatePart.DefaultValue != null)
|
if (templatePart.IsOptional && templatePart.DefaultValue != null)
|
||||||
{
|
{
|
||||||
// Cannot be optional and have a default value.
|
// Cannot be optional and have a default value.
|
||||||
// The only way to declare an optional parameter is to have a ? at the end,
|
// The only way to declare an optional parameter is to have a ? at the end,
|
||||||
// hence we cannot have both default value and optional parameter within the template.
|
// hence we cannot have both default value and optional parameter within the template.
|
||||||
// A workaround is to add it as a separate entry in the defaults argument.
|
// A workaround is to add it as a separate entry in the defaults argument.
|
||||||
context.Error = Resources.TemplateRoute_OptionalCannotHaveDefaultValue;
|
context.Error = Resources.TemplateRoute_OptionalCannotHaveDefaultValue;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
var parameterName = templatePart.Name;
|
var parameterName = templatePart.Name;
|
||||||
if (IsValidParameterName(context, parameterName))
|
if (IsValidParameterName(context, parameterName))
|
||||||
{
|
{
|
||||||
segment.Parts.Add(templatePart);
|
segment.Parts.Add(templatePart);
|
||||||
|
|
@ -232,7 +232,7 @@ namespace Microsoft.AspNet.Routing.Template
|
||||||
|
|
||||||
if (context.Current == OpenBrace)
|
if (context.Current == OpenBrace)
|
||||||
{
|
{
|
||||||
// This is an 'escaped' brace in a literal, like "{{foo" - keep going.
|
// This is an 'escaped' brace in a literal, like "{{foo" - keep going.
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
@ -254,7 +254,7 @@ namespace Microsoft.AspNet.Routing.Template
|
||||||
|
|
||||||
if (context.Current == CloseBrace)
|
if (context.Current == CloseBrace)
|
||||||
{
|
{
|
||||||
// This is an 'escaped' brace in a literal, like "{{foo" - keep going.
|
// This is an 'escaped' brace in a literal, like "{{foo" - keep going.
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
@ -292,7 +292,7 @@ namespace Microsoft.AspNet.Routing.Template
|
||||||
for (var j = 0; j < segment.Parts.Count; j++)
|
for (var j = 0; j < segment.Parts.Count; j++)
|
||||||
{
|
{
|
||||||
var part = segment.Parts[j];
|
var part = segment.Parts[j];
|
||||||
if (part.IsParameter &&
|
if (part.IsParameter &&
|
||||||
part.IsCatchAll &&
|
part.IsCatchAll &&
|
||||||
(i != segments.Count - 1 || j != segment.Parts.Count - 1))
|
(i != segments.Count - 1 || j != segment.Parts.Count - 1))
|
||||||
{
|
{
|
||||||
|
|
@ -425,8 +425,8 @@ namespace Microsoft.AspNet.Routing.Template
|
||||||
}
|
}
|
||||||
|
|
||||||
public HashSet<string> ParameterNames
|
public HashSet<string> ParameterNames
|
||||||
{
|
{
|
||||||
get { return _parameterNames; }
|
get { return _parameterNames; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool Back()
|
public bool Back()
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@ namespace Microsoft.AspNet.Routing.Template
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
public static TemplatePart CreateParameter([NotNull] string name,
|
public static TemplatePart CreateParameter([NotNull] string name,
|
||||||
bool isCatchAll,
|
bool isCatchAll,
|
||||||
bool isOptional,
|
bool isOptional,
|
||||||
object defaultValue,
|
object defaultValue,
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,7 @@ namespace Microsoft.AspNet.Routing.Template
|
||||||
|
|
||||||
public TemplateRoute(
|
public TemplateRoute(
|
||||||
[NotNull] IRouter target,
|
[NotNull] IRouter target,
|
||||||
string routeTemplate,
|
string routeTemplate,
|
||||||
IInlineConstraintResolver inlineConstraintResolver)
|
IInlineConstraintResolver inlineConstraintResolver)
|
||||||
: this(target,
|
: this(target,
|
||||||
routeTemplate,
|
routeTemplate,
|
||||||
|
|
@ -259,7 +259,7 @@ namespace Microsoft.AspNet.Routing.Template
|
||||||
private static IReadOnlyDictionary<string, IRouteConstraint> GetConstraints(
|
private static IReadOnlyDictionary<string, IRouteConstraint> GetConstraints(
|
||||||
IInlineConstraintResolver inlineConstraintResolver,
|
IInlineConstraintResolver inlineConstraintResolver,
|
||||||
string template,
|
string template,
|
||||||
RouteTemplate parsedTemplate,
|
RouteTemplate parsedTemplate,
|
||||||
IDictionary<string, object> constraints)
|
IDictionary<string, object> constraints)
|
||||||
{
|
{
|
||||||
var constraintBuilder = new RouteConstraintBuilder(inlineConstraintResolver, template);
|
var constraintBuilder = new RouteConstraintBuilder(inlineConstraintResolver, template);
|
||||||
|
|
|
||||||
|
|
@ -16,14 +16,14 @@ namespace Microsoft.AspNet.Routing.Template
|
||||||
public IDictionary<string, object> AcceptedValues { get; set; }
|
public IDictionary<string, object> AcceptedValues { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The set of values that that were supplied for URL generation.
|
/// The set of values that that were supplied for URL generation.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <remarks>
|
/// <remarks>
|
||||||
/// This combines implicit (ambient) values from the <see cref="RouteData"/> of the current request
|
/// This combines implicit (ambient) values from the <see cref="RouteData"/> of the current request
|
||||||
/// (if applicable), explictly provided values, and default values for parameters that appear in
|
/// (if applicable), explictly provided values, and default values for parameters that appear in
|
||||||
/// the route template.
|
/// the route template.
|
||||||
///
|
///
|
||||||
/// Implicit (ambient) values which are invalidated due to changes in values lexically earlier in the
|
/// Implicit (ambient) values which are invalidated due to changes in values lexically earlier in the
|
||||||
/// route template are excluded from this set.
|
/// route template are excluded from this set.
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
public IDictionary<string, object> CombinedValues { get; set; }
|
public IDictionary<string, object> CombinedValues { get; set; }
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@ namespace Microsoft.AspNet.Routing
|
||||||
public class VirtualPathContext
|
public class VirtualPathContext
|
||||||
{
|
{
|
||||||
public VirtualPathContext(HttpContext httpContext,
|
public VirtualPathContext(HttpContext httpContext,
|
||||||
IDictionary<string, object> ambientValues,
|
IDictionary<string, object> ambientValues,
|
||||||
IDictionary<string, object> values)
|
IDictionary<string, object> values)
|
||||||
: this(httpContext, ambientValues, values, null)
|
: this(httpContext, ambientValues, values, null)
|
||||||
{
|
{
|
||||||
|
|
@ -28,14 +28,14 @@ namespace Microsoft.AspNet.Routing
|
||||||
|
|
||||||
public string RouteName { get; private set; }
|
public string RouteName { get; private set; }
|
||||||
|
|
||||||
public IDictionary<string, object> ProvidedValues { get; set; }
|
public IDictionary<string, object> ProvidedValues { get; set; }
|
||||||
|
|
||||||
public IDictionary<string, object> AmbientValues { get; private set; }
|
public IDictionary<string, object> AmbientValues { get; private set; }
|
||||||
|
|
||||||
public HttpContext Context { get; private set; }
|
public HttpContext Context { get; private set; }
|
||||||
|
|
||||||
public bool IsBound { get; set; }
|
public bool IsBound { get; set; }
|
||||||
|
|
||||||
public IDictionary<string, object> Values { get; private set; }
|
public IDictionary<string, object> Values { get; private set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -31,7 +31,7 @@ namespace Microsoft.AspNet.Routing.Tests
|
||||||
{
|
{
|
||||||
// Arrange
|
// Arrange
|
||||||
var constraint = new BoolRouteConstraint();
|
var constraint = new BoolRouteConstraint();
|
||||||
|
|
||||||
// Act
|
// Act
|
||||||
var actual = ConstraintsTestHelper.TestConstraint(constraint, parameterValue);
|
var actual = ConstraintsTestHelper.TestConstraint(constraint, parameterValue);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -35,7 +35,7 @@ namespace Microsoft.AspNet.Routing.Tests
|
||||||
Assert.Equal(expected, actual);
|
Assert.Equal(expected, actual);
|
||||||
}
|
}
|
||||||
|
|
||||||
static Expression<Func<IRouteConstraint, bool>> ConstraintMatchMethodExpression =
|
static Expression<Func<IRouteConstraint, bool>> ConstraintMatchMethodExpression =
|
||||||
c => c.Match(It.IsAny<HttpContext>(),
|
c => c.Match(It.IsAny<HttpContext>(),
|
||||||
It.IsAny<IRouter>(),
|
It.IsAny<IRouter>(),
|
||||||
It.IsAny<string>(),
|
It.IsAny<string>(),
|
||||||
|
|
|
||||||
|
|
@ -23,9 +23,9 @@ namespace Microsoft.AspNet.Routing.Tests
|
||||||
|
|
||||||
// Act
|
// Act
|
||||||
var result = constraint.Match(
|
var result = constraint.Match(
|
||||||
Mock.Of<HttpContext>(),
|
Mock.Of<HttpContext>(),
|
||||||
Mock.Of<IRouter>(),
|
Mock.Of<IRouter>(),
|
||||||
"area",
|
"area",
|
||||||
new RouteValueDictionary(new { controller = "Home", action = "Index" }),
|
new RouteValueDictionary(new { controller = "Home", action = "Index" }),
|
||||||
direction);
|
direction);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -268,7 +268,7 @@ namespace Microsoft.AspNet.Routing.Tests
|
||||||
// Act & Assert
|
// Act & Assert
|
||||||
var ex = Assert.Throws<InvalidOperationException>(() => resolver.ResolveConstraint("custom"));
|
var ex = Assert.Throws<InvalidOperationException>(() => resolver.ResolveConstraint("custom"));
|
||||||
Assert.Equal("The constraint type 'System.String' which is mapped to constraint key 'custom'"+
|
Assert.Equal("The constraint type 'System.String' which is mapped to constraint key 'custom'"+
|
||||||
" must implement the 'IRouteConstraint' interface.",
|
" must implement the 'IRouteConstraint' interface.",
|
||||||
ex.Message);
|
ex.Message);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -91,7 +91,7 @@ namespace Microsoft.AspNet.Routing.Tests
|
||||||
{
|
{
|
||||||
// Arrange & Act
|
// Arrange & Act
|
||||||
var template = ParseRouteTemplate(@"some/url-{p1:int:test(3)=hello}/{p2=abc}/{p3?}");
|
var template = ParseRouteTemplate(@"some/url-{p1:int:test(3)=hello}/{p2=abc}/{p3?}");
|
||||||
|
|
||||||
// Assert
|
// Assert
|
||||||
var parameters = template.Parameters.ToArray();
|
var parameters = template.Parameters.ToArray();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@ namespace Microsoft.AspNet.Routing
|
||||||
public class TestSink
|
public class TestSink
|
||||||
{
|
{
|
||||||
public TestSink(
|
public TestSink(
|
||||||
Func<WriteContext, bool> writeEnabled = null,
|
Func<WriteContext, bool> writeEnabled = null,
|
||||||
Func<BeginScopeContext, bool> beginEnabled = null)
|
Func<BeginScopeContext, bool> beginEnabled = null)
|
||||||
{
|
{
|
||||||
WriteEnabled = writeEnabled;
|
WriteEnabled = writeEnabled;
|
||||||
|
|
|
||||||
|
|
@ -227,10 +227,10 @@ namespace Microsoft.AspNet.Routing.Tests
|
||||||
|
|
||||||
private class IndexerProperty
|
private class IndexerProperty
|
||||||
{
|
{
|
||||||
public bool this[string key]
|
public bool this[string key]
|
||||||
{
|
{
|
||||||
get { return false; }
|
get { return false; }
|
||||||
set {}
|
set {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@ namespace Microsoft.AspNet.Routing
|
||||||
var isHandled = false;
|
var isHandled = false;
|
||||||
|
|
||||||
var sink = new TestSink(
|
var sink = new TestSink(
|
||||||
TestSink.EnableWithTypeName<RouterMiddleware>,
|
TestSink.EnableWithTypeName<RouterMiddleware>,
|
||||||
TestSink.EnableWithTypeName<RouterMiddleware>);
|
TestSink.EnableWithTypeName<RouterMiddleware>);
|
||||||
var loggerFactory = new TestLoggerFactory(sink, enabled: true);
|
var loggerFactory = new TestLoggerFactory(sink, enabled: true);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -25,100 +25,100 @@ namespace Microsoft.AspNet.Routing.Template.Tests
|
||||||
{
|
{
|
||||||
new object[]
|
new object[]
|
||||||
{
|
{
|
||||||
"Test/{val1}/{val2}",
|
"Test/{val1}/{val2}",
|
||||||
new RouteValueDictionary(new {val1 = "", val2 = ""}),
|
new RouteValueDictionary(new {val1 = "", val2 = ""}),
|
||||||
new RouteValueDictionary(new {val2 = "SomeVal2"}),
|
new RouteValueDictionary(new {val2 = "SomeVal2"}),
|
||||||
null,
|
null,
|
||||||
},
|
},
|
||||||
new object[]
|
new object[]
|
||||||
{
|
{
|
||||||
"Test/{val1}/{val2}",
|
"Test/{val1}/{val2}",
|
||||||
new RouteValueDictionary(new {val1 = "", val2 = ""}),
|
new RouteValueDictionary(new {val1 = "", val2 = ""}),
|
||||||
new RouteValueDictionary(new {val1 = "a"}),
|
new RouteValueDictionary(new {val1 = "a"}),
|
||||||
"Test/a"
|
"Test/a"
|
||||||
},
|
},
|
||||||
new object[]
|
new object[]
|
||||||
{
|
{
|
||||||
"Test/{val1}/{val2}/{val3}",
|
"Test/{val1}/{val2}/{val3}",
|
||||||
new RouteValueDictionary(new {val1 = "", val3 = ""}),
|
new RouteValueDictionary(new {val1 = "", val3 = ""}),
|
||||||
new RouteValueDictionary(new {val2 = "a"}),
|
new RouteValueDictionary(new {val2 = "a"}),
|
||||||
null
|
null
|
||||||
},
|
},
|
||||||
new object[]
|
new object[]
|
||||||
{
|
{
|
||||||
"Test/{val1}/{val2}",
|
"Test/{val1}/{val2}",
|
||||||
new RouteValueDictionary(new {val1 = "", val2 = ""}),
|
new RouteValueDictionary(new {val1 = "", val2 = ""}),
|
||||||
new RouteValueDictionary(new {val1 = "a", val2 = "b"}),
|
new RouteValueDictionary(new {val1 = "a", val2 = "b"}),
|
||||||
"Test/a/b"
|
"Test/a/b"
|
||||||
},
|
},
|
||||||
new object[]
|
new object[]
|
||||||
{
|
{
|
||||||
"Test/{val1}/{val2}/{val3}",
|
"Test/{val1}/{val2}/{val3}",
|
||||||
new RouteValueDictionary(new {val1 = "", val2 = "", val3 = ""}),
|
new RouteValueDictionary(new {val1 = "", val2 = "", val3 = ""}),
|
||||||
new RouteValueDictionary(new {val1 = "a", val2 = "b", val3 = "c"}),
|
new RouteValueDictionary(new {val1 = "a", val2 = "b", val3 = "c"}),
|
||||||
"Test/a/b/c"
|
"Test/a/b/c"
|
||||||
},
|
},
|
||||||
new object[]
|
new object[]
|
||||||
{
|
{
|
||||||
"Test/{val1}/{val2}/{val3}",
|
"Test/{val1}/{val2}/{val3}",
|
||||||
new RouteValueDictionary(new {val1 = "", val2 = "", val3 = ""}),
|
new RouteValueDictionary(new {val1 = "", val2 = "", val3 = ""}),
|
||||||
new RouteValueDictionary(new {val1 = "a", val2 = "b"}),
|
new RouteValueDictionary(new {val1 = "a", val2 = "b"}),
|
||||||
"Test/a/b"
|
"Test/a/b"
|
||||||
},
|
},
|
||||||
new object[]
|
new object[]
|
||||||
{
|
{
|
||||||
"Test/{val1}/{val2}/{val3}",
|
"Test/{val1}/{val2}/{val3}",
|
||||||
new RouteValueDictionary(new {val1 = "", val2 = "", val3 = ""}),
|
new RouteValueDictionary(new {val1 = "", val2 = "", val3 = ""}),
|
||||||
new RouteValueDictionary(new {val1 = "a"}),
|
new RouteValueDictionary(new {val1 = "a"}),
|
||||||
"Test/a"
|
"Test/a"
|
||||||
},
|
},
|
||||||
new object[]
|
new object[]
|
||||||
{
|
{
|
||||||
"Test/{val1}",
|
"Test/{val1}",
|
||||||
new RouteValueDictionary(new {val1 = "42", val2 = "", val3 = ""}),
|
new RouteValueDictionary(new {val1 = "42", val2 = "", val3 = ""}),
|
||||||
new RouteValueDictionary(),
|
new RouteValueDictionary(),
|
||||||
"Test"
|
"Test"
|
||||||
},
|
},
|
||||||
new object[]
|
new object[]
|
||||||
{
|
{
|
||||||
"Test/{val1}/{val2}/{val3}",
|
"Test/{val1}/{val2}/{val3}",
|
||||||
new RouteValueDictionary(new {val1 = "42", val2 = (string)null, val3 = (string)null}),
|
new RouteValueDictionary(new {val1 = "42", val2 = (string)null, val3 = (string)null}),
|
||||||
new RouteValueDictionary(),
|
new RouteValueDictionary(),
|
||||||
"Test"
|
"Test"
|
||||||
},
|
},
|
||||||
new object[]
|
new object[]
|
||||||
{
|
{
|
||||||
"Test/{val1}/{val2}/{val3}/{val4}",
|
"Test/{val1}/{val2}/{val3}/{val4}",
|
||||||
new RouteValueDictionary(new {val1 = "21", val2 = "", val3 = "", val4 = ""}),
|
new RouteValueDictionary(new {val1 = "21", val2 = "", val3 = "", val4 = ""}),
|
||||||
new RouteValueDictionary(new {val1 = "42", val2 = "11", val3 = "", val4 = ""}),
|
new RouteValueDictionary(new {val1 = "42", val2 = "11", val3 = "", val4 = ""}),
|
||||||
"Test/42/11"
|
"Test/42/11"
|
||||||
},
|
},
|
||||||
new object[]
|
new object[]
|
||||||
{
|
{
|
||||||
"Test/{val1}/{val2}/{val3}",
|
"Test/{val1}/{val2}/{val3}",
|
||||||
new RouteValueDictionary(new {val1 = "21", val2 = "", val3 = ""}),
|
new RouteValueDictionary(new {val1 = "21", val2 = "", val3 = ""}),
|
||||||
new RouteValueDictionary(new {val1 = "42"}),
|
new RouteValueDictionary(new {val1 = "42"}),
|
||||||
"Test/42"
|
"Test/42"
|
||||||
},
|
},
|
||||||
new object[]
|
new object[]
|
||||||
{
|
{
|
||||||
"Test/{val1}/{val2}/{val3}/{val4}",
|
"Test/{val1}/{val2}/{val3}/{val4}",
|
||||||
new RouteValueDictionary(new {val1 = "21", val2 = "", val3 = "", val4 = ""}),
|
new RouteValueDictionary(new {val1 = "21", val2 = "", val3 = "", val4 = ""}),
|
||||||
new RouteValueDictionary(new {val1 = "42", val2 = "11"}),
|
new RouteValueDictionary(new {val1 = "42", val2 = "11"}),
|
||||||
"Test/42/11"
|
"Test/42/11"
|
||||||
},
|
},
|
||||||
new object[]
|
new object[]
|
||||||
{
|
{
|
||||||
"Test/{val1}/{val2}/{val3}",
|
"Test/{val1}/{val2}/{val3}",
|
||||||
new RouteValueDictionary(new {val1 = "21", val2 = (string)null, val3 = (string)null}),
|
new RouteValueDictionary(new {val1 = "21", val2 = (string)null, val3 = (string)null}),
|
||||||
new RouteValueDictionary(new {val1 = "42"}),
|
new RouteValueDictionary(new {val1 = "42"}),
|
||||||
"Test/42"
|
"Test/42"
|
||||||
},
|
},
|
||||||
new object[]
|
new object[]
|
||||||
{
|
{
|
||||||
"Test/{val1}/{val2}/{val3}/{val4}",
|
"Test/{val1}/{val2}/{val3}/{val4}",
|
||||||
new RouteValueDictionary(new {val1 = "21", val2 = (string)null, val3 = (string)null, val4 = (string)null}),
|
new RouteValueDictionary(new {val1 = "21", val2 = (string)null, val3 = (string)null, val4 = (string)null}),
|
||||||
new RouteValueDictionary(new {val1 = "42", val2 = "11"}),
|
new RouteValueDictionary(new {val1 = "42", val2 = "11"}),
|
||||||
"Test/42/11"
|
"Test/42/11"
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
@ -901,8 +901,8 @@ namespace Microsoft.AspNet.Routing.Template.Tests
|
||||||
{
|
{
|
||||||
// DevDiv Bugs 199612: UrlRouting: UrlGeneration should not append parameter to query string if it is a Constraint parameter and not a Url parameter
|
// DevDiv Bugs 199612: UrlRouting: UrlGeneration should not append parameter to query string if it is a Constraint parameter and not a Url parameter
|
||||||
RunTest(
|
RunTest(
|
||||||
"{Controller}.mvc/{action}/{end}",
|
"{Controller}.mvc/{action}/{end}",
|
||||||
null,
|
null,
|
||||||
new RouteValueDictionary(new { foo = CreateHttpMethodConstraint("GET") }),
|
new RouteValueDictionary(new { foo = CreateHttpMethodConstraint("GET") }),
|
||||||
new RouteValueDictionary(),
|
new RouteValueDictionary(),
|
||||||
new RouteValueDictionary(new { controller = "Orders", action = "Index", end = "end", foo = "GET" }),
|
new RouteValueDictionary(new { controller = "Orders", action = "Index", end = "end", foo = "GET" }),
|
||||||
|
|
|
||||||
|
|
@ -520,7 +520,7 @@ namespace Microsoft.AspNet.Routing.Template
|
||||||
{
|
{
|
||||||
// Arrange
|
// Arrange
|
||||||
var route = CreateRoute(
|
var route = CreateRoute(
|
||||||
"{controller}/{action}",
|
"{controller}/{action}",
|
||||||
defaults: new { action = "Index" },
|
defaults: new { action = "Index" },
|
||||||
dataTokens: new { culture = "en-CA" });
|
dataTokens: new { culture = "en-CA" });
|
||||||
|
|
||||||
|
|
@ -1057,7 +1057,7 @@ namespace Microsoft.AspNet.Routing.Template
|
||||||
// Arrange
|
// Arrange
|
||||||
var routeBuilder = CreateRouteBuilder();
|
var routeBuilder = CreateRouteBuilder();
|
||||||
|
|
||||||
// Act
|
// Act
|
||||||
routeBuilder.MapRoute("mockName",
|
routeBuilder.MapRoute("mockName",
|
||||||
"{controller}/{action}",
|
"{controller}/{action}",
|
||||||
defaults: null,
|
defaults: null,
|
||||||
|
|
|
||||||
|
|
@ -60,7 +60,7 @@ namespace Microsoft.AspNet.Routing.Tests
|
||||||
public void EmptyDefaultValue_WithOptionalParameter_Throws()
|
public void EmptyDefaultValue_WithOptionalParameter_Throws()
|
||||||
{
|
{
|
||||||
// Arrange
|
// Arrange
|
||||||
var message = "An optional parameter cannot have default value." + Environment.NewLine +
|
var message = "An optional parameter cannot have default value." + Environment.NewLine +
|
||||||
"Parameter name: routeTemplate";
|
"Parameter name: routeTemplate";
|
||||||
var routeBuilder = CreateRouteBuilder();
|
var routeBuilder = CreateRouteBuilder();
|
||||||
|
|
||||||
|
|
@ -78,7 +78,7 @@ namespace Microsoft.AspNet.Routing.Tests
|
||||||
public void NonEmptyDefaultValue_WithOptionalParameter_Throws()
|
public void NonEmptyDefaultValue_WithOptionalParameter_Throws()
|
||||||
{
|
{
|
||||||
// Arrange
|
// Arrange
|
||||||
var message = "An optional parameter cannot have default value." + Environment.NewLine +
|
var message = "An optional parameter cannot have default value." + Environment.NewLine +
|
||||||
"Parameter name: routeTemplate";
|
"Parameter name: routeTemplate";
|
||||||
var routeBuilder = CreateRouteBuilder();
|
var routeBuilder = CreateRouteBuilder();
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue