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

ModelStateDictionary contains garbage entries for DateTimeOffset[] #2192

Closed
dougbu opened this issue Mar 17, 2015 · 2 comments
Closed

ModelStateDictionary contains garbage entries for DateTimeOffset[] #2192

dougbu opened this issue Mar 17, 2015 · 2 comments
Assignees
Milestone

Comments

@dougbu
Copy link
Member

dougbu commented Mar 17, 2015

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

@danroth27 danroth27 added this to the 6.0.0-rc1 milestone Mar 18, 2015
@danroth27
Copy link
Member

@dougbu Is this just for DateTimeOffset[] or are other types affected as well?

@harshgMSFT
Copy link
Contributor

Should be affecting anything and everything related to a collection.

@danroth27 danroth27 assigned ajaybhargavb and unassigned kirthik Mar 18, 2015
dougbu referenced this issue Mar 20, 2015
- remaining `MutableObjectModelBinder` tests
- functional test of #2129 scenario
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants