<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
  <title type="html">Comments - Code - eCraft Labs</title>
  <icon>http://labs.ecraft.com/Content/icons/favicon.ico</icon>
  <logo>http://labs.ecraft.com/Content/icons/favicon.png</logo>
  <updated>2010-03-25T15:52:41.497</updated>
  <id>http://labs.ecraft.com/tags/code/comments/atom</id>
  <link rel="alternate" type="text/html" hreflang="en" href="/tags/code/atom"/>
  <link rel="self" type="application/atom+xml" href="http://labs.ecraft.com/Tags/Code/Comments/ATOM"/>
  <generator uri="http://oxite.net" version="1.0">Oxite</generator>
  <entry>
    <title type="html">Extension Method: Convenient way to add items to an ICollection&lt;T&gt;</title>
    <link rel="alternate" type="text/html" href="http://labs.ecraft.com/Code/Extension-Method-Convenient-way-to-add-items-to-an-ICollectionT#c-201003250352414"/>
    <id>http://labs.ecraft.com/Code/Extension-Method-Convenient-way-to-add-items-to-an-ICollectionT#c-201003250352414</id>
    <updated>2010-03-25T15:52:41.497</updated>
    <published>2010-03-25T15:52:41.497</published>
    <author>
      <name>Per Lundberg</name>
    </author>
    <content type="html" xml:lang="en">
      Valid points, yes. :-)

But perhaps there are other situations when the extension method *would* be more useful? I remember to have written something like this in a project, but I didn't find it now when looking...
    </content>
  </entry>
  <entry>
    <title type="html">Extension Method: Convenient way to add items to an ICollection&lt;T&gt;</title>
    <link rel="alternate" type="text/html" href="http://labs.ecraft.com/Code/Extension-Method-Convenient-way-to-add-items-to-an-ICollectionT#c-201003240256520"/>
    <id>http://labs.ecraft.com/Code/Extension-Method-Convenient-way-to-add-items-to-an-ICollectionT#c-201003240256520</id>
    <updated>2010-03-24T14:56:52.017</updated>
    <published>2010-03-24T14:56:52.017</published>
    <author>
      <name>Simon</name>
    </author>
    <content type="html" xml:lang="en">
      ..obviously there should be angle brackets. Seems the blog software ate them...
    </content>
  </entry>
  <entry>
    <title type="html">Extension Method: Convenient way to add items to an ICollection&lt;T&gt;</title>
    <link rel="alternate" type="text/html" href="http://labs.ecraft.com/Code/Extension-Method-Convenient-way-to-add-items-to-an-ICollectionT#c-201003240253558"/>
    <id>http://labs.ecraft.com/Code/Extension-Method-Convenient-way-to-add-items-to-an-ICollectionT#c-201003240253558</id>
    <updated>2010-03-24T14:53:55.883</updated>
    <published>2010-03-24T14:53:55.883</published>
    <author>
      <name>Simon</name>
    </author>
    <content type="html" xml:lang="en">
      While extension methods are neat, in this case it's not needed at all as you can just use collection initializers like so:

IEnumerable&lt;Customer&gt; customers = new List&lt;Customer&gt; {
                new Customer { CustomerNumber=123456, Name=&quot;Customer #1&quot;},
                new Customer { CustomerNumber=123456, Name=&quot;Customer #2&quot;}};

..and while not applicable in this case, I hope you are aware of Ghostdoc.

A *class* named I&lt;Foo&gt; doesn't seem like good naming to me..
    </content>
  </entry>
</feed>
