<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/'><id>tag:blogger.com,1999:blog-36201586.post5100110944141112474..comments</id><updated>2008-09-07T12:03:38.243+01:00</updated><title type='text'>Comments on Derek says:: Generic collections and inheritance</title><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://derek-says.blogspot.com/feeds/5100110944141112474/comments/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/36201586/5100110944141112474/comments/default'/><link rel='alternate' type='text/html' href='http://derek-says.blogspot.com/2008/08/generic-collections-and-inheritance.html'/><author><name>Derek Fowler</name><uri>http://www.blogger.com/profile/09963865123124577525</uri><email>noreply@blogger.com</email></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>4</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-36201586.post-3043877134873915139</id><published>2008-09-06T03:37:00.000+01:00</published><updated>2008-09-06T03:37:00.000+01:00</updated><title type='text'>Agree with Sam. A much easier way is to call .Cast...</title><content type='html'>Agree with Sam. A much easier way is to call .Cast() and then .ToList()&lt;BR/&gt;&lt;BR/&gt;i.e.&lt;BR/&gt;List&amp;amp;ltTDerived&amp;amp;gt derivedList = new...&lt;BR/&gt;&lt;BR/&gt;public static ListTest(List&amp;amp;ltTBase&amp;amp;gt base){...}&lt;BR/&gt;&lt;BR/&gt;ListTest(derivedList.Cast&amp;amp;ltTBase&amp;amp;gt().ToList&amp;amp;ltTBase&amp;amp;gt());</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/36201586/5100110944141112474/comments/default/3043877134873915139'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/36201586/5100110944141112474/comments/default/3043877134873915139'/><link rel='alternate' type='text/html' href='http://derek-says.blogspot.com/2008/08/generic-collections-and-inheritance.html?showComment=1220668620000#c3043877134873915139' title=''/><author><name>jason</name><uri>http://www.blogger.com/profile/17722392642811835963</uri><email>noreply@blogger.com</email></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://derek-says.blogspot.com/2008/08/generic-collections-and-inheritance.html' ref='tag:blogger.com,1999:blog-36201586.post-5100110944141112474' source='http://www.blogger.com/feeds/36201586/posts/default/5100110944141112474' type='text/html'/></entry><entry><id>tag:blogger.com,1999:blog-36201586.post-1717647128685043071</id><published>2008-08-05T10:48:00.000+01:00</published><updated>2008-08-05T10:48:00.000+01:00</updated><title type='text'>If you're using .Net 3.5 you can use the Enumerabl...</title><content type='html'>If you're using .Net 3.5 you can use the Enumerable.Cast and Enumerable.OfType extension methods to do the same thing.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/36201586/5100110944141112474/comments/default/1717647128685043071'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/36201586/5100110944141112474/comments/default/1717647128685043071'/><link rel='alternate' type='text/html' href='http://derek-says.blogspot.com/2008/08/generic-collections-and-inheritance.html?showComment=1217929680000#c1717647128685043071' title=''/><author><name>Sam</name><uri>http://www.blogger.com/profile/01345100698738870730</uri><email>noreply@blogger.com</email></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://derek-says.blogspot.com/2008/08/generic-collections-and-inheritance.html' ref='tag:blogger.com,1999:blog-36201586.post-5100110944141112474' source='http://www.blogger.com/feeds/36201586/posts/default/5100110944141112474' type='text/html'/></entry><entry><id>tag:blogger.com,1999:blog-36201586.post-3049974443489490048</id><published>2008-08-05T10:00:00.000+01:00</published><updated>2008-08-05T10:00:00.000+01:00</updated><title type='text'>I had no idea you could use yield like that. That'...</title><content type='html'>I had no idea you could use &lt;I&gt;yield&lt;/I&gt; like that. That's a better solution than mine, thanks for sharing.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/36201586/5100110944141112474/comments/default/3049974443489490048'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/36201586/5100110944141112474/comments/default/3049974443489490048'/><link rel='alternate' type='text/html' href='http://derek-says.blogspot.com/2008/08/generic-collections-and-inheritance.html?showComment=1217926800000#c3049974443489490048' title=''/><author><name>Derek Fowler</name><uri>http://www.blogger.com/profile/09963865123124577525</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='01005108689222898985'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://derek-says.blogspot.com/2008/08/generic-collections-and-inheritance.html' ref='tag:blogger.com,1999:blog-36201586.post-5100110944141112474' source='http://www.blogger.com/feeds/36201586/posts/default/5100110944141112474' type='text/html'/></entry><entry><id>tag:blogger.com,1999:blog-36201586.post-4133827314430589215</id><published>2008-08-05T08:40:00.000+01:00</published><updated>2008-08-05T08:40:00.000+01:00</updated><title type='text'>I feel your pain ;) I ended up creating a similar ...</title><content type='html'>I feel your pain ;) I ended up creating a similar method on my EnumerableHelper class:&lt;BR/&gt;&lt;BR/&gt;public static IEnumerable&amp;lt;TBase&amp;gt; Convert&amp;lt;TDerived, TBase&amp;gt;(IEnumerable&amp;lt;TDerived&amp;gt; enumeration)&lt;BR/&gt;            where TDerived : TBase&lt;BR/&gt;        {&lt;BR/&gt;            foreach (TDerived element in enumeration)&lt;BR/&gt;            {&lt;BR/&gt;                yield return element;&lt;BR/&gt;            }&lt;BR/&gt;        }</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/36201586/5100110944141112474/comments/default/4133827314430589215'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/36201586/5100110944141112474/comments/default/4133827314430589215'/><link rel='alternate' type='text/html' href='http://derek-says.blogspot.com/2008/08/generic-collections-and-inheritance.html?showComment=1217922000000#c4133827314430589215' title=''/><author><name>timvw</name><uri>http://www.blogger.com/profile/11373008902278757108</uri><email>noreply@blogger.com</email></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://derek-says.blogspot.com/2008/08/generic-collections-and-inheritance.html' ref='tag:blogger.com,1999:blog-36201586.post-5100110944141112474' source='http://www.blogger.com/feeds/36201586/posts/default/5100110944141112474' type='text/html'/></entry></feed>