Add culture constructor to RouteValueProvider #5812
Conversation
/// <param name="bindingSource">The <see cref="BindingSource"/> of the data.</param> | ||
/// <param name="values">The values.</param> | ||
/// <param name="culture">The culture for route value.</param> | ||
public RouteValueProvider(BindingSource bindingSource, RouteValueDictionary values, CultureInfo culture) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add to the docs for the other constructor that it will use the InvariantCulture
.
@@ -52,6 +69,8 @@ protected PrefixContainer PrefixContainer | |||
} | |||
} | |||
|
|||
protected CultureInfo Culture { get; } = CultureInfo.InvariantCulture; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The general pattern when you have an optional constructor argument is to have the shorter constructor overload call the longer one and pass in the default value that way, rather than setting it directly on a property.
While this will work, it's going to catch someone out who's reading the code.
@@ -21,10 +21,11 @@ public class RouteValueProvider : BindingSourceValueProvider | |||
/// </summary> | |||
/// <param name="bindingSource">The <see cref="BindingSource"/> of the data.</param> | |||
/// <param name="values">The values.</param> | |||
/// <remarks>Sets Culture to CultureInfo.InvariantCulture.</remarks> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use <see...>
ef46a0e
to
f667a7d
Compare
caf5b48
to
366dbde
Compare
Fixes #5336 using a similar format to ElementalValueProvider.