Quantcast
Channel: ASPNETWebStack Issue Tracker Rss Feed
Viewing all articles
Browse latest Browse all 7215

Created Issue: ExpressionHelper.GetExpressionText is incorrectly parsing special lambda expressions [638]

$
0
0
c.For(x => Html.TextBoxFor(y => x.Name)) such an expression is incorrectly parsed.
In debug the expression for TextBoxFor is
{y => value(System.Runtime.CompilerServices.StrongBox`1[ListModelBinding.Models.ItemModel]).Value.Name}

As you can see there is a ".Value" that is not stripped away like ".Model".

In my opinion the code should be:

// If it starts with "model", then strip that away
if (nameParts.Count > 0 && (String.Equals(nameParts.Peek(), ".model", StringComparison.OrdinalIgnoreCase) ||
String.Equals(nameParts.Peek(), ".value", StringComparison.OrdinalIgnoreCase)))
{
nameParts.Pop();
}

See also on stackoverflow: http://stackoverflow.com/questions/13543073/asp-net-mvc-expressionhelper-getexpressiontext-returning-wrong-property-name


Viewing all articles
Browse latest Browse all 7215

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>