<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Dan Merino&#039;s Blog &#187; StructureMap</title>
	<atom:link href="http://blog.danmerino.com/tag/structuremap/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.danmerino.com</link>
	<description>Computer Science, Entrepreneurship and Productivity</description>
	<lastBuildDate>Wed, 21 Dec 2011 06:34:01 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>StructureMap Multiple Parameters</title>
		<link>http://blog.danmerino.com/structuremap-multiple-parameters/</link>
		<comments>http://blog.danmerino.com/structuremap-multiple-parameters/#comments</comments>
		<pubDate>Sat, 03 Jul 2010 08:28:30 +0000</pubDate>
		<dc:creator>danmerino</dc:creator>
				<category><![CDATA[Inversion of Control]]></category>
		<category><![CDATA[StructureMap]]></category>
		<category><![CDATA[multiple]]></category>
		<category><![CDATA[paratmenters]]></category>

		<guid isPermaLink="false">http://blog.codingadventure.com/?p=242</guid>
		<description><![CDATA[Tweet One of the common questions about IOC is how to pass parameters. This question is specially common with StructureMap since a lot of the old methods have been deprecated. Here is a quick Example: and you can call it &#8230; <a href="http://blog.danmerino.com/structuremap-multiple-parameters/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<div class="bottomcontainerBox" style="border:1px solid #808080;background-color:#F0F4F9;">
			<div style="float:left; width:85px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fblog.danmerino.com%2Fstructuremap-multiple-parameters%2F&amp;layout=button_count&amp;show_faces=false&amp;width=85&amp;action=like&amp;font=verdana&amp;colorscheme=light&amp;height=21" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width=85px; height:21px;" allowTransparency="true"></iframe></div>
			<div style="float:left; width:80px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<g:plusone size="medium" href="http://blog.danmerino.com/structuremap-multiple-parameters/"></g:plusone>
			</div>
			<div style="float:left; width:95px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<a href="http://twitter.com/share" class="twitter-share-button" data-url="http://blog.danmerino.com/structuremap-multiple-parameters/"  data-text="StructureMap Multiple Parameters" data-count="horizontal">Tweet</a>
			</div><div style="float:left; width:105px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;"><script type="in/share" data-url="http://blog.danmerino.com/structuremap-multiple-parameters/" data-counter="right"></script></div>			
			<div style="float:left; width:85px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;"><script src="http://www.stumbleupon.com/hostedbadge.php?s=1&amp;r=http://blog.danmerino.com/structuremap-multiple-parameters/"></script></div>			
			</div><div style="clear:both"></div><div style="padding-bottom:4px;"></div><p>One of the common questions about <a href="http://blog.codingadventure.com/2010/02/04/inversion-of-control/">IOC</a> is how to pass parameters. This question is specially common with <a href="http://structuremap.github.com/structuremap/index.html">StructureMap</a> since a lot of the old methods have been deprecated.</p>
<p>Here is a quick Example:</p>
<pre class="brush: csharp; title: ; notranslate">

public class DataSource : IDataSource
{
        public DataSource(string URL, string account, string password)
        {
                     //your code here
         }

}
</pre>
<pre class="brush: csharp; title: ; notranslate">

ObjectFactory.Initialize(x =&gt;
{
      x.For&lt;IDataSource&gt;().Use&lt;DataSource&gt;()
           .Ctor&lt;string&gt;(&quot;URL&quot;).Is(URL)
           .Ctor&lt;string&gt;(&quot;account&quot;).Is(account)
           .Ctor&lt;string&gt;(&quot;password&quot;).Is(password)
           ;
}
</pre>
<p>and you can call it like this:</p>
<pre class="brush: csharp; title: ; notranslate">

private IDataSource ds = ObjectFactory.GetInstance&lt;IDataSource&gt;();
</pre>
<p>There is a huge amount of benefits as I mentioned in my <a href="http://blog.codingadventure.com/2010/02/04/inversion-of-control/">previous post</a>, including saving a lot of typing since all parameters are preconfigured.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.danmerino.com/structuremap-multiple-parameters/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

