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

Edited Issue: ExpressionHelper.GetExpressionText is incorrectly parsing nested lambda expressions [638]

$
0
0
c.For(x => Html.TextBoxFor(y => x.Name)) such an expression is incorrectly parsed to "Value.Name" instead of "Name". C.For is a definition for a grid column in MVCContrib.<br /><br />In debug view the expression for TextBoxFor is<br /> {y => value(System.Runtime.CompilerServices.StrongBox`1[ListModelBinding.Models.ItemModel]).Value.Name}<br /><br />As you can see there is a ".Value" that is not stripped away like ".Model".<br /><br />In my opinion the code in ExpressionHelper.GetExpressionText should be:<br /><br /> // If it starts with "model", then strip that away<br /> if (nameParts.Count > 0 && (String.Equals(nameParts.Peek(), ".model", StringComparison.OrdinalIgnoreCase) ||<br /> String.Equals(nameParts.Peek(), ".value", StringComparison.OrdinalIgnoreCase)))<br /> {<br /> nameParts.Pop();<br /> }<br /><br />See also on stackoverflow: http://stackoverflow.com/questions/13543073/asp-net-mvc-expressionhelper-getexpressiontext-returning-wrong-property-name<br />

Viewing all articles
Browse latest Browse all 7215

Trending Articles



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