<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Polymorphism in Expression trees</title>
	<atom:link href="http://lostechies.com/jimmybogard/2009/02/25/polymorphism-in-expression-trees/feed/" rel="self" type="application/rss+xml" />
	<link>http://lostechies.com/jimmybogard/2009/02/25/polymorphism-in-expression-trees/</link>
	<description>Strong opinions, weakly held</description>
	<lastBuildDate>Thu, 23 May 2013 23:40:00 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.4.2</generator>
	<item>
		<title>By: Jaime</title>
		<link>http://lostechies.com/jimmybogard/2009/02/25/polymorphism-in-expression-trees/#comment-1354</link>
		<dc:creator>Jaime</dc:creator>
		<pubDate>Thu, 26 Feb 2009 16:16:28 +0000</pubDate>
		<guid isPermaLink="false">/blogs/jimmy_bogard/archive/2009/02/24/polymorphism-in-expression-trees.aspx#comment-1354</guid>
		<description>Would this do the trick?
body.Expression.Type == typeof(Child)
</description>
		<content:encoded><![CDATA[<p>Would this do the trick?<br />
body.Expression.Type == typeof(Child)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: bogardj</title>
		<link>http://lostechies.com/jimmybogard/2009/02/25/polymorphism-in-expression-trees/#comment-1353</link>
		<dc:creator>bogardj</dc:creator>
		<pubDate>Wed, 25 Feb 2009 16:36:08 +0000</pubDate>
		<guid isPermaLink="false">/blogs/jimmy_bogard/archive/2009/02/24/polymorphism-in-expression-trees.aspx#comment-1353</guid>
		<description>@Chad

Yeah, going off of typeof(Child) would work.  Nate Kohari made my test pass:

http://pastie.org/399708

I see this as a crazy hack, and means I can&#039;t trust any MemberInfo directly in an expression tree.

It&#039;s also borked for MethodCallExpression as well.</description>
		<content:encoded><![CDATA[<p>@Chad</p>
<p>Yeah, going off of typeof(Child) would work.  Nate Kohari made my test pass:</p>
<p><a href="http://pastie.org/399708" rel="nofollow">http://pastie.org/399708</a></p>
<p>I see this as a crazy hack, and means I can&#8217;t trust any MemberInfo directly in an expression tree.</p>
<p>It&#8217;s also borked for MethodCallExpression as well.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: chadmyers</title>
		<link>http://lostechies.com/jimmybogard/2009/02/25/polymorphism-in-expression-trees/#comment-1352</link>
		<dc:creator>chadmyers</dc:creator>
		<pubDate>Wed, 25 Feb 2009 15:32:01 +0000</pubDate>
		<guid isPermaLink="false">/blogs/jimmy_bogard/archive/2009/02/24/polymorphism-in-expression-trees.aspx#comment-1352</guid>
		<description>Does the test work if you use string-based reflection?  I&#039;m probably wrong, but your assertion seems incorrect.</description>
		<content:encoded><![CDATA[<p>Does the test work if you use string-based reflection?  I&#8217;m probably wrong, but your assertion seems incorrect.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: bogardj</title>
		<link>http://lostechies.com/jimmybogard/2009/02/25/polymorphism-in-expression-trees/#comment-1351</link>
		<dc:creator>bogardj</dc:creator>
		<pubDate>Wed, 25 Feb 2009 13:24:51 +0000</pubDate>
		<guid isPermaLink="false">/blogs/jimmy_bogard/archive/2009/02/24/polymorphism-in-expression-trees.aspx#comment-1351</guid>
		<description>@Scott

That does let me get to the correct type of the parameter, but I&#039;ll have to re-interrogate that type to get the correct MemberInfo.  I ran into this trying to get attributes from a Property, and found it didn&#039;t have the derived type&#039;s MemberInfo.</description>
		<content:encoded><![CDATA[<p>@Scott</p>
<p>That does let me get to the correct type of the parameter, but I&#8217;ll have to re-interrogate that type to get the correct MemberInfo.  I ran into this trying to get attributes from a Property, and found it didn&#8217;t have the derived type&#8217;s MemberInfo.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Scott Allen</title>
		<link>http://lostechies.com/jimmybogard/2009/02/25/polymorphism-in-expression-trees/#comment-1350</link>
		<dc:creator>Scott Allen</dc:creator>
		<pubDate>Wed, 25 Feb 2009 01:57:55 +0000</pubDate>
		<guid isPermaLink="false">/blogs/jimmy_bogard/archive/2009/02/24/polymorphism-in-expression-trees.aspx#comment-1350</guid>
		<description>Perhaps you should be looking at the parameter type for the expression instead of the declaring type of the property?

i.e.

((MemberExpression)func.Body).Expression.Type
</description>
		<content:encoded><![CDATA[<p>Perhaps you should be looking at the parameter type for the expression instead of the declaring type of the property?</p>
<p>i.e.</p>
<p>((MemberExpression)func.Body).Expression.Type</p>
]]></content:encoded>
	</item>
</channel>
</rss>
