You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Dec 14, 2018. It is now read-only.
ViewDataDictionary.ModelMetadata.Model and ViewDataDictionary.Model can easily get out of sync
e.g. controller passes 23 to a view and ViewData.Model=24 executes in the view; later helpers (especially the lambda-based ones) will use ViewData.ModelMetadata.Model, which is still 23
ViewDataDictionary.ModelMetadata==null isn’t always true when ViewDataDictionary.Model==null
in the false cases, ViewDataDictionary.ModelMetadata.ModelType may not match the containing page’s @model type (a corner case)
generally ViewDataDictionary contract isn't clear nor implemented consistently
ViewDataDictionary<int>.Model will throw an NRE if it is read before it’s written
should return 0 in this case
some calls to the ViewDataDictionary and ViewDataDictionary<TModel> constructors (e.g. from page activation) are incorrect for the intended semantics
“incorrect” is usually limited to ViewDataDictionary.ModelState being empty but could, in corner cases, lead to unwarranted errors about invalid model values