[Fixes #351] Error message incorrectly references RouteCollection when you don't set the default handler on RouteBuilder

This commit is contained in:
Kiran Challa 2016-08-29 14:52:34 -07:00
parent 95a7785a12
commit 56b3fb9b6f
3 changed files with 6 additions and 6 deletions

View File

@ -104,7 +104,7 @@ namespace Microsoft.AspNetCore.Builder
{ {
if (routeBuilder.DefaultHandler == null) if (routeBuilder.DefaultHandler == null)
{ {
throw new RouteCreationException(Resources.DefaultHandler_MustBeSet); throw new RouteCreationException(Resources.FormatDefaultHandler_MustBeSet(nameof(IRouteBuilder)));
} }
var inlineConstraintResolver = routeBuilder var inlineConstraintResolver = routeBuilder

View File

@ -75,7 +75,7 @@ namespace Microsoft.AspNetCore.Routing
} }
/// <summary> /// <summary>
/// A default handler must be set on the RouteCollection. /// A default handler must be set on the {0}.
/// </summary> /// </summary>
internal static string DefaultHandler_MustBeSet internal static string DefaultHandler_MustBeSet
{ {
@ -83,11 +83,11 @@ namespace Microsoft.AspNetCore.Routing
} }
/// <summary> /// <summary>
/// A default handler must be set on the RouteCollection. /// A default handler must be set on the {0}.
/// </summary> /// </summary>
internal static string FormatDefaultHandler_MustBeSet() internal static string FormatDefaultHandler_MustBeSet(object p0)
{ {
return GetString("DefaultHandler_MustBeSet"); return string.Format(CultureInfo.CurrentCulture, GetString("DefaultHandler_MustBeSet"), p0);
} }
/// <summary> /// <summary>

View File

@ -130,7 +130,7 @@
<value>The supplied route name '{0}' is ambiguous and matched more than one route.</value> <value>The supplied route name '{0}' is ambiguous and matched more than one route.</value>
</data> </data>
<data name="DefaultHandler_MustBeSet" xml:space="preserve"> <data name="DefaultHandler_MustBeSet" xml:space="preserve">
<value>A default handler must be set on the RouteCollection.</value> <value>A default handler must be set on the {0}.</value>
</data> </data>
<data name="DefaultInlineConstraintResolver_AmbiguousCtors" xml:space="preserve"> <data name="DefaultInlineConstraintResolver_AmbiguousCtors" xml:space="preserve">
<value>The constructor to use for activating the constraint type '{0}' is ambiguous. Multiple constructors were found with the following number of parameters: {1}.</value> <value>The constructor to use for activating the constraint type '{0}' is ambiguous. Multiple constructors were found with the following number of parameters: {1}.</value>