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

Make string-based expression evaluations behave consistently #2686

Closed
wants to merge 1 commit into from

Conversation

dougbu
Copy link
Member

@dougbu dougbu commented Jun 10, 2015

nits:

  • move some comments describing ViewDataEvaluator methods above the methods

- #1485, #1487
 - handle `TemplateInfo.HtmlFieldPrefix` in `ViewDataEvaluator.Eval()`
  - attempt lookup in the `ViewDataDictionary` using full name then evaluate
    relative `expression` against `viewData.Model`
  - handle `null` or empty `expression` special case in this method (remove `throw`s)
 - always pass relative `expression` name into `Eval()`
  - remove `null` or empty `expression` handling from higher-level code
  - in a couple of cases, special-case returned `ViewDataInfo`
- #2662
 - remove incorrect guard from `DefaultHtmlGenerator.GenerateRadioButtion()`
- add doc comments for the core methods that have changed
- enable unit tests skipped due to one of above bugs
 - fix one (yeah, just one) other test with incorrect expectations
- remove functional test comments about the above bugs and update expectations

nits:
- move some comments describing `ViewDataEvaluator` methods above the methods
@dougbu
Copy link
Member Author

dougbu commented Jun 10, 2015

/cc @rynowak (because I know how much you love ViewDataDictionary)
/cc @Eilon just because (well, because we discussed this fix already)

@dougbu
Copy link
Member Author

dougbu commented Jun 14, 2015

ping @rynowak

@@ -1194,7 +1185,11 @@ private static string GetInputTypeString(InputType inputType)
string expression)
{
var value = viewContext.ViewData.Eval(expression);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add comment about expecting user to provide select list items in the dictionary and (definitely) not as the Model.

@dougbu
Copy link
Member Author

dougbu commented Jun 17, 2015

Offline :shipit: from @rynowak with new comment

@dougbu
Copy link
Member Author

dougbu commented Jun 17, 2015

27283ec

@dougbu dougbu closed this Jun 17, 2015
@dougbu dougbu deleted the dougbu/viewdata.eval.1485.1487.2662 branch June 17, 2015 05:20
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants