- 
                Notifications
    You must be signed in to change notification settings 
- Fork 10.5k
Closed
Labels
affected-very-fewThis issue impacts very few customersThis issue impacts very few customersfeature-model-bindinginvestigateold-area-web-frameworks-do-not-use*DEPRECATED* This label is deprecated in favor of the area-mvc and area-minimal labels*DEPRECATED* This label is deprecated in favor of the area-mvc and area-minimal labels
Milestone
Description
Is there an existing issue for this?
- I have searched the existing issues
Describe the bug
public class SomeValueProvider : IValueProvider
{
  public bool ContainsPrefix(string prefix)
  {
    return true;
  }
  public ValueProviderResult GetValue(string key)
  {
    return new ValueProviderResult(new string[] { "a", "b", null, "c" });
  }
}Controller method
public async Task<IActionResult> Index(List<string> list)
{
  await Task.Yield();
  // Returned list "a", b", "b",  "c"
  // Expected list "a", b", null, "c"
  return Content("<pre>returns "+string.Join(",", list)+ " expected a,b,,c</pre>", "text/html");
}Expected Behavior
When using an Array of strings having null values in it, it must not skip, nor must it repeat previous element values.
Steps To Reproduce
The bug is visible in this small test project:
https://github.com/alphons/ValueProviderBug
Exceptions (if any)
No exceptions, bug procudes wrong processing of Array elements having null values.
.NET Version
6.0.102
Anything else?
ASP.NET 6.0.2
Metadata
Metadata
Assignees
Labels
affected-very-fewThis issue impacts very few customersThis issue impacts very few customersfeature-model-bindinginvestigateold-area-web-frameworks-do-not-use*DEPRECATED* This label is deprecated in favor of the area-mvc and area-minimal labels*DEPRECATED* This label is deprecated in favor of the area-mvc and area-minimal labels