Comments on: How to get property name from lambda https://www.limilabs.com/blog/property-name-from-lambda Using Limilabs .net components Thu, 22 Sep 2011 10:51:17 +0000 hourly 1 https://wordpress.org/?v=6.6.5 By: Stephane https://www.limilabs.com/blog/property-name-from-lambda#comment-1426 Thu, 22 Sep 2011 10:51:17 +0000 http://www.limilabs.com/blog/?p=472#comment-1426 Thanks, works perfectly. Just what I was looking for.

]]>
By: INotifyPropertyChanged with lambdas https://www.limilabs.com/blog/property-name-from-lambda#comment-1425 Mon, 23 May 2011 15:55:05 +0000 http://www.limilabs.com/blog/?p=472#comment-1425 […]   ProtocolExHow to get property name from lambda Email template engine […]

]]>
By: Limilabs support https://www.limilabs.com/blog/property-name-from-lambda#comment-1424 Mon, 05 Apr 2010 20:37:47 +0000 http://www.limilabs.com/blog/?p=472#comment-1424 Could you write a unit test for this situation?

]]>
By: Victor https://www.limilabs.com/blog/property-name-from-lambda#comment-1423 Fri, 02 Apr 2010 12:48:43 +0000 http://www.limilabs.com/blog/?p=472#comment-1423 Actually i maid a small mistake , you shoud pass expression.body in case of LambdaExpression, because LambdaExpression itself is not member expression and you’re code will throw an exception otherwise

]]>
By: Limilabs support https://www.limilabs.com/blog/property-name-from-lambda#comment-1422 Fri, 02 Apr 2010 08:43:18 +0000 http://www.limilabs.com/blog/?p=472#comment-1422 Why?

]]>
By: Victor https://www.limilabs.com/blog/property-name-from-lambda#comment-1421 Thu, 01 Apr 2010 21:02:05 +0000 http://www.limilabs.com/blog/?p=472#comment-1421 I think you have to modify GetMemberName at least a little, and put the following code in the begining

if (expression is LambdaExpression)
{
var lambdaExpression = (LambdaExpression)expression;
var compiled = lambdaExpression.Compile();

if (lambdaExpression.Body.NodeType == ExpressionType.MemberAccess)
{
return GetMemberName(lambdaExpression.Body);
}
}

]]>