Skip to content
This repository was archived by the owner on Dec 14, 2018. It is now read-only.
This repository was archived by the owner on Dec 14, 2018. It is now read-only.

ModelStateDictionary contains garbage entries for DateTimeOffset[] #2192

@dougbu

Description

@dougbu

This is a regression from Beta3. I have not tested with other collecition types.

  1. create a model that is a DateTimeOffset[] or that contains a property of that array type
  2. create an action of the form public IActionResult Dates([FromForm(Name = "")] DateTimeOffset[] model) or whatever works for your more complex type
  3. create a matching action that invokes a view submitting to above action
  4. run in the debugger
  5. hit Submit in the browser
  6. break on the first line of the action from step 2
  7. observe garbage in modelstate
  8. note that even though the parameter is fully-populated and the model is valid, ModelState.IsValid is false.
  9. a similar scenario using Beta3 (and [Bind(Prefix ="")] instead of [FromForm(Name = "")]) does not have Length or similar entries in the ModelState. ModelState.IsValid is true when using that version.

/cc @harshgMSFT

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions