<?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: Use ModelBinder to Generically Bind Complex Types</title>
	<atom:link href="http://www.emadibrahim.com/2008/09/03/use-modelbinder-to-generically-bind-complex-types/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.emadibrahim.com/2008/09/03/use-modelbinder-to-generically-bind-complex-types/</link>
	<description>web development, tech reviews, tips, tricks, blogging</description>
	<lastBuildDate>Sun, 07 Mar 2010 18:27:34 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Stephen Edwards</title>
		<link>http://www.emadibrahim.com/2008/09/03/use-modelbinder-to-generically-bind-complex-types/comment-page-1/#comment-923</link>
		<dc:creator>Stephen Edwards</dc:creator>
		<pubDate>Mon, 08 Sep 2008 03:38:35 +0000</pubDate>
		<guid isPermaLink="false">http://www.emadibrahim.com/2008/09/03/use-modelbinder-to-generically-bind-complex-types/#comment-923</guid>
		<description>Well how about this:&lt;br&gt;&lt;br&gt;I exposed the protected UpdateModel in my controller:&lt;br&gt;&lt;br&gt;        public void UpdateModel(BusinessSavingsRequest bsr, string[] keys)&lt;br&gt;        {&lt;br&gt;            base.UpdateModel(bsr, keys);&lt;br&gt;        }&lt;br&gt;&lt;br&gt;and then call it from my binder:&lt;br&gt;&lt;br&gt;        public object GetValue(ControllerContext controllerContext, string modelName, Type modelType, ModelStateDictionary modelState)&lt;br&gt;        {&lt;br&gt;            BusinessSavingsRequest bsr = new BusinessSavingsRequest();&lt;br&gt;            string[] properties = typeof(BusinessSavingsRequest).GetProperties().Select(p =&gt; p.Name).ToArray();&lt;br&gt;            ((MvcApplication.Controllers.BusinessSavingsController)controllerContext.Controller).UpdateModel(bsr, properties);&lt;br&gt;            return bsr;&lt;br&gt;        }&lt;br&gt;&lt;br&gt;Perhaps if this is all it needed to do I wouldnt have a custom binder for the type.</description>
		<content:encoded><![CDATA[<p>Well how about this:</p>
<p>I exposed the protected UpdateModel in my controller:</p>
<p>        public void UpdateModel(BusinessSavingsRequest bsr, string[] keys)<br />        {<br />            base.UpdateModel(bsr, keys);<br />        }</p>
<p>and then call it from my binder:</p>
<p>        public object GetValue(ControllerContext controllerContext, string modelName, Type modelType, ModelStateDictionary modelState)<br />        {<br />            BusinessSavingsRequest bsr = new BusinessSavingsRequest();<br />            string[] properties = typeof(BusinessSavingsRequest).GetProperties().Select(p =&gt; p.Name).ToArray();<br />            ((MvcApplication.Controllers.BusinessSavingsController)controllerContext.Controller).UpdateModel(bsr, properties);<br />            return bsr;<br />        }</p>
<p>Perhaps if this is all it needed to do I wouldnt have a custom binder for the type.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Stephen Edwards</title>
		<link>http://www.emadibrahim.com/2008/09/03/use-modelbinder-to-generically-bind-complex-types/comment-page-1/#comment-626</link>
		<dc:creator>Stephen Edwards</dc:creator>
		<pubDate>Sun, 07 Sep 2008 20:38:35 +0000</pubDate>
		<guid isPermaLink="false">http://www.emadibrahim.com/2008/09/03/use-modelbinder-to-generically-bind-complex-types/#comment-626</guid>
		<description>Well how about this:&lt;br&gt;&lt;br&gt;I exposed the protected UpdateModel in my controller:&lt;br&gt;&lt;br&gt;        public void UpdateModel(BusinessSavingsRequest bsr, string[] keys)&lt;br&gt;        {&lt;br&gt;            base.UpdateModel(bsr, keys);&lt;br&gt;        }&lt;br&gt;&lt;br&gt;and then call it from my binder:&lt;br&gt;&lt;br&gt;        public object GetValue(ControllerContext controllerContext, string modelName, Type modelType, ModelStateDictionary modelState)&lt;br&gt;        {&lt;br&gt;            BusinessSavingsRequest bsr = new BusinessSavingsRequest();&lt;br&gt;            string[] properties = typeof(BusinessSavingsRequest).GetProperties().Select(p =&gt; p.Name).ToArray();&lt;br&gt;            ((MvcApplication.Controllers.BusinessSavingsController)controllerContext.Controller).UpdateModel(bsr, properties);&lt;br&gt;            return bsr;&lt;br&gt;        }&lt;br&gt;&lt;br&gt;Perhaps if this is all it needed to do I wouldnt have a custom binder for the type.</description>
		<content:encoded><![CDATA[<p>Well how about this:</p>
<p>I exposed the protected UpdateModel in my controller:</p>
<p>        public void UpdateModel(BusinessSavingsRequest bsr, string[] keys)<br />        {<br />            base.UpdateModel(bsr, keys);<br />        }</p>
<p>and then call it from my binder:</p>
<p>        public object GetValue(ControllerContext controllerContext, string modelName, Type modelType, ModelStateDictionary modelState)<br />        {<br />            BusinessSavingsRequest bsr = new BusinessSavingsRequest();<br />            string[] properties = typeof(BusinessSavingsRequest).GetProperties().Select(p =&gt; p.Name).ToArray();<br />            ((MvcApplication.Controllers.BusinessSavingsController)controllerContext.Controller).UpdateModel(bsr, properties);<br />            return bsr;<br />        }</p>
<p>Perhaps if this is all it needed to do I wouldnt have a custom binder for the type.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Steve</title>
		<link>http://www.emadibrahim.com/2008/09/03/use-modelbinder-to-generically-bind-complex-types/comment-page-1/#comment-613</link>
		<dc:creator>Steve</dc:creator>
		<pubDate>Thu, 04 Sep 2008 14:33:03 +0000</pubDate>
		<guid isPermaLink="false">http://www.emadibrahim.com/2008/09/03/use-modelbinder-to-generically-bind-complex-types/#comment-613</guid>
		<description>The ComplexModelBinder doesn&#039;t make much sense in his post.&lt;br&gt;&lt;br&gt;How do you use it?  Why the need to &#039;register&#039; it.&lt;br&gt;&lt;br&gt;Seems to me if you pass a complex type as a parameter, it would map the form variables to the type with reflection - and only if you need to have more complex mapping would you create a specific binder...</description>
		<content:encoded><![CDATA[<p>The ComplexModelBinder doesn&#39;t make much sense in his post.</p>
<p>How do you use it?  Why the need to &#39;register&#39; it.</p>
<p>Seems to me if you pass a complex type as a parameter, it would map the form variables to the type with reflection &#8211; and only if you need to have more complex mapping would you create a specific binder&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: eibrahim</title>
		<link>http://www.emadibrahim.com/2008/09/03/use-modelbinder-to-generically-bind-complex-types/comment-page-1/#comment-611</link>
		<dc:creator>eibrahim</dc:creator>
		<pubDate>Wed, 03 Sep 2008 16:57:18 +0000</pubDate>
		<guid isPermaLink="false">http://www.emadibrahim.com/2008/09/03/use-modelbinder-to-generically-bind-complex-types/#comment-611</guid>
		<description>Yeah, I love Disqus... I actually don&#039;t have to log in to my admin tool to&lt;br&gt;moderate my comments.  I simply reply to a comment with &quot;approve&quot; and it&lt;br&gt;gets approved.  Or If I reply with some other text, it approves the comment&lt;br&gt;and submits my text as a comment.  Very neat.&lt;br&gt;I am looking into the ComplexModelBinder and trying to get things working&lt;br&gt;with the built-in stuff :)</description>
		<content:encoded><![CDATA[<p>Yeah, I love Disqus&#8230; I actually don&#39;t have to log in to my admin tool to<br />moderate my comments.  I simply reply to a comment with &#8220;approve&#8221; and it<br />gets approved.  Or If I reply with some other text, it approves the comment<br />and submits my text as a comment.  Very neat.<br />I am looking into the ComplexModelBinder and trying to get things working<br />with the built-in stuff :)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Simone</title>
		<link>http://www.emadibrahim.com/2008/09/03/use-modelbinder-to-generically-bind-complex-types/comment-page-1/#comment-610</link>
		<dc:creator>Simone</dc:creator>
		<pubDate>Wed, 03 Sep 2008 16:37:23 +0000</pubDate>
		<guid isPermaLink="false">http://www.emadibrahim.com/2008/09/03/use-modelbinder-to-generically-bind-complex-types/#comment-610</guid>
		<description>No problem :)&lt;br&gt;btw: this threaded comment view is awesome</description>
		<content:encoded><![CDATA[<p>No problem :)<br />btw: this threaded comment view is awesome</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: eibrahim</title>
		<link>http://www.emadibrahim.com/2008/09/03/use-modelbinder-to-generically-bind-complex-types/comment-page-1/#comment-608</link>
		<dc:creator>eibrahim</dc:creator>
		<pubDate>Wed, 03 Sep 2008 16:21:15 +0000</pubDate>
		<guid isPermaLink="false">http://www.emadibrahim.com/2008/09/03/use-modelbinder-to-generically-bind-complex-types/#comment-608</guid>
		<description>You are absolutely right.  It is hard to find these things without good&lt;br&gt;documentation.  But I just  found some info at&lt;br&gt;&lt;a href=&quot;http://weblogs.asp.net/scottgu/archive/2008/09/02/asp-net-mvc-preview-5-and-form-posting-scenarios.aspx&quot;&gt;http://weblogs.asp.net/scottgu/archive/2008/09/...&lt;/a&gt;&lt;br&gt;I will update the post to direct readers there.&lt;br&gt;&lt;br&gt;Thanks for the heads up.</description>
		<content:encoded><![CDATA[<p>You are absolutely right.  It is hard to find these things without good<br />documentation.  But I just  found some info at<br /><a href="http://weblogs.asp.net/scottgu/archive/2008/09/02/asp-net-mvc-preview-5-and-form-posting-scenarios.aspx"></a><a href="http://weblogs.asp.net/scottgu/archive/2008/09/.." rel="nofollow">http://weblogs.asp.net/scottgu/archive/2008/09/..</a>.<br />I will update the post to direct readers there.</p>
<p>Thanks for the heads up.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: eibrahim</title>
		<link>http://www.emadibrahim.com/2008/09/03/use-modelbinder-to-generically-bind-complex-types/comment-page-1/#comment-609</link>
		<dc:creator>eibrahim</dc:creator>
		<pubDate>Wed, 03 Sep 2008 16:21:15 +0000</pubDate>
		<guid isPermaLink="false">http://www.emadibrahim.com/2008/09/03/use-modelbinder-to-generically-bind-complex-types/#comment-609</guid>
		<description>You are absolutely right.  It is hard to find these things without good&lt;br&gt;documentation.  But I just  found some info at&lt;br&gt;&lt;a href=&quot;http://weblogs.asp.net/scottgu/archive/2008/09/02/asp-net-mvc-preview-5-and-form-posting-scenarios.aspx&quot;&gt;http://weblogs.asp.net/scottgu/archive/2008/09/...&lt;/a&gt;&lt;br&gt;I will update the post to direct readers there.&lt;br&gt;&lt;br&gt;Thanks for the heads up.</description>
		<content:encoded><![CDATA[<p>You are absolutely right.  It is hard to find these things without good<br />documentation.  But I just  found some info at<br /><a href="http://weblogs.asp.net/scottgu/archive/2008/09/02/asp-net-mvc-preview-5-and-form-posting-scenarios.aspx"></a><a href="http://weblogs.asp.net/scottgu/archive/2008/09/.." rel="nofollow">http://weblogs.asp.net/scottgu/archive/2008/09/..</a>.<br />I will update the post to direct readers there.</p>
<p>Thanks for the heads up.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Simone</title>
		<link>http://www.emadibrahim.com/2008/09/03/use-modelbinder-to-generically-bind-complex-types/comment-page-1/#comment-607</link>
		<dc:creator>Simone</dc:creator>
		<pubDate>Wed, 03 Sep 2008 16:08:40 +0000</pubDate>
		<guid isPermaLink="false">http://www.emadibrahim.com/2008/09/03/use-modelbinder-to-generically-bind-complex-types/#comment-607</guid>
		<description>Isn&#039;t this what the ComplexBinder that comes with MVC P5 already does?</description>
		<content:encoded><![CDATA[<p>Isn&#39;t this what the ComplexBinder that comes with MVC P5 already does?</p>
]]></content:encoded>
	</item>
</channel>
</rss>
