title: Using Autofac and multiple WithMetadata assignments
body: <p>I am trying to use Autofac specifying 2 metadata items.  It seems to add these fine, however, I am not too clear on how to retrieve the service by specifying both of these items.  I have metadata items for an Assembly Name and a Version.  The registration snippet is as follows:</p>
  
  <pre><code>builder.RegisterAssemblyTypes(assembly).Where(
  t =&gt; t.GetInterfaces().Any(i =&gt; 
  plugin.Interface == i.Name)).As&lt;IPlugin&gt;()
  .WithMetadata&lt;IMetaDataName&gt;(m =&gt; m.For(pn =&gt; pn.Name, name)
  .WithMetadata&lt;IMetaDataVersion&gt;(m =&gt; m.For(pn =&gt; pn.Version, version)
  </code></pre>
  
  <p>The only documentation and examples I can find specify that I can use this syntax:</p>
  
  <pre><code>IEnumerable&lt;Lazy&lt;IPlugin, IMetaDataName&gt;&gt;
  </code></pre>
  
  <p>in the costructor of the class or in a class that resolves the service I am after.  What I am after is a mechanism to let me do the following:</p>
  
  <pre><code>Get the service that has the MetaDataName == "Service1" AND MetaDataVersion == "1.4"
  </code></pre>
  
  <p>Currently I have concatenated the two together for 1 metadata type which works but feels clunky.  Is there are better approach to this?</p>
  
  <p>Thanks</p>
  
  <p>Craig.</p>