<?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: Domain entities vs presentation model objects, part 2: mapping</title>
	<atom:link href="http://richarddingwall.name/2009/03/02/domain-entities-vs-presentation-model-objects-part-2-mapping/feed/" rel="self" type="application/rss+xml" />
	<link>http://richarddingwall.name/2009/03/02/domain-entities-vs-presentation-model-objects-part-2-mapping/</link>
	<description>The adventures of a young kiwi software developer in London</description>
	<lastBuildDate>Thu, 10 May 2012 16:20:46 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
	<item>
		<title>By: Richard</title>
		<link>http://richarddingwall.name/2009/03/02/domain-entities-vs-presentation-model-objects-part-2-mapping/comment-page-1/#comment-59550</link>
		<dc:creator>Richard</dc:creator>
		<pubDate>Thu, 08 Mar 2012 11:18:41 +0000</pubDate>
		<guid isPermaLink="false">http://richarddingwall.name/?p=1022#comment-59550</guid>
		<description>@Darryl: sorry nothing that specific. I would probably look at doing something like &#039;get dropdown items&#039; via AJAX.</description>
		<content:encoded><![CDATA[<p>@Darryl: sorry nothing that specific. I would probably look at doing something like &#8216;get dropdown items&#8217; via AJAX.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Darryl Matthews</title>
		<link>http://richarddingwall.name/2009/03/02/domain-entities-vs-presentation-model-objects-part-2-mapping/comment-page-1/#comment-59477</link>
		<dc:creator>Darryl Matthews</dc:creator>
		<pubDate>Wed, 07 Mar 2012 18:33:52 +0000</pubDate>
		<guid isPermaLink="false">http://richarddingwall.name/?p=1022#comment-59477</guid>
		<description>I think I may have found an approach that will work with dropdownlists and reading the information back in the controller.  Check out this &lt;a href=&quot;http://www.mikesdotnetting.com/Article/134/Validating-the-Contact-Manager-with-MVC-2.0-And-VS-2010&quot; rel=&quot;nofollow&quot;&gt; Validating The Contact Manager&lt;/a&gt; example.  Although it doesn&#039;t directly address dropdowns, it has one in the example.  

It would appear that you could retrieve data back from the view using the model but you need to exclude the dropdown fields as part of the parameters of the Action definition.  You can then specificially get the values back from the view using Viewdata and the name of the field in the view.  I haven&#039;t exactly tried this approach but it makes sense and it would allow me to use viewmodels that have lists in them.  I hope this is helpful.  

Richard:  Have you done any blog posts on cascading dropdownlists where the contents of one list is filtered by a selection in a preceeding list?</description>
		<content:encoded><![CDATA[<p>I think I may have found an approach that will work with dropdownlists and reading the information back in the controller.  Check out this <a href="http://www.mikesdotnetting.com/Article/134/Validating-the-Contact-Manager-with-MVC-2.0-And-VS-2010" rel="nofollow"> Validating The Contact Manager</a> example.  Although it doesn&#8217;t directly address dropdowns, it has one in the example.  </p>
<p>It would appear that you could retrieve data back from the view using the model but you need to exclude the dropdown fields as part of the parameters of the Action definition.  You can then specificially get the values back from the view using Viewdata and the name of the field in the view.  I haven&#8217;t exactly tried this approach but it makes sense and it would allow me to use viewmodels that have lists in them.  I hope this is helpful.  </p>
<p>Richard:  Have you done any blog posts on cascading dropdownlists where the contents of one list is filtered by a selection in a preceeding list?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Vaibhav</title>
		<link>http://richarddingwall.name/2009/03/02/domain-entities-vs-presentation-model-objects-part-2-mapping/comment-page-1/#comment-59472</link>
		<dc:creator>Vaibhav</dc:creator>
		<pubDate>Wed, 07 Mar 2012 17:42:30 +0000</pubDate>
		<guid isPermaLink="false">http://richarddingwall.name/?p=1022#comment-59472</guid>
		<description>@Richard, should we use different model for populating data on the form, and a different model for getting the data from the form.
@Darryl, Thanks for asking this question.</description>
		<content:encoded><![CDATA[<p>@Richard, should we use different model for populating data on the form, and a different model for getting the data from the form.<br />
@Darryl, Thanks for asking this question.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Richard</title>
		<link>http://richarddingwall.name/2009/03/02/domain-entities-vs-presentation-model-objects-part-2-mapping/comment-page-1/#comment-59469</link>
		<dc:creator>Richard</dc:creator>
		<pubDate>Wed, 07 Mar 2012 17:17:51 +0000</pubDate>
		<guid isPermaLink="false">http://richarddingwall.name/?p=1022#comment-59469</guid>
		<description>Not at all. It&#039;s just the fact you&#039;re throwing lots of data at the view to populate it then only interested in reading one or two values back. So you can&#039;t use the same model for both.</description>
		<content:encoded><![CDATA[<p>Not at all. It&#8217;s just the fact you&#8217;re throwing lots of data at the view to populate it then only interested in reading one or two values back. So you can&#8217;t use the same model for both.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Darryl Matthews</title>
		<link>http://richarddingwall.name/2009/03/02/domain-entities-vs-presentation-model-objects-part-2-mapping/comment-page-1/#comment-59462</link>
		<dc:creator>Darryl Matthews</dc:creator>
		<pubDate>Wed, 07 Mar 2012 16:11:43 +0000</pubDate>
		<guid isPermaLink="false">http://richarddingwall.name/?p=1022#comment-59462</guid>
		<description>I guess the challenge is what does that model look like where you pass in a list to the view for a particular field but then get only a single value posted from that same field.  I&#039;m not sure how the HTML looks for that field in the view.  

Maybe its me.  I am I the only one on the planet that uses dropdown lists as input fields on a form?  In all of the examples lifted up in the MVC community, no one seems to address it in a way that a newbie like myself can grasp the approach.  Thanks for your prompt response Richard.</description>
		<content:encoded><![CDATA[<p>I guess the challenge is what does that model look like where you pass in a list to the view for a particular field but then get only a single value posted from that same field.  I&#8217;m not sure how the HTML looks for that field in the view.  </p>
<p>Maybe its me.  I am I the only one on the planet that uses dropdown lists as input fields on a form?  In all of the examples lifted up in the MVC community, no one seems to address it in a way that a newbie like myself can grasp the approach.  Thanks for your prompt response Richard.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Richard</title>
		<link>http://richarddingwall.name/2009/03/02/domain-entities-vs-presentation-model-objects-part-2-mapping/comment-page-1/#comment-59461</link>
		<dc:creator>Richard</dc:creator>
		<pubDate>Wed, 07 Mar 2012 16:06:05 +0000</pubDate>
		<guid isPermaLink="false">http://richarddingwall.name/?p=1022#comment-59461</guid>
		<description>@Darryl: the model you should read back from the UI would have a single field for the selected value. No collection.</description>
		<content:encoded><![CDATA[<p>@Darryl: the model you should read back from the UI would have a single field for the selected value. No collection.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Darryl Matthews</title>
		<link>http://richarddingwall.name/2009/03/02/domain-entities-vs-presentation-model-objects-part-2-mapping/comment-page-1/#comment-59457</link>
		<dc:creator>Darryl Matthews</dc:creator>
		<pubDate>Wed, 07 Mar 2012 14:40:08 +0000</pubDate>
		<guid isPermaLink="false">http://richarddingwall.name/?p=1022#comment-59457</guid>
		<description>Piggybacking on Vaibhav&#039;s question:  Suppose you have a collection that you are passing to the view to populate a dropdown list.  Your view takes in a collection/list but the view should return a selected value from that list.  How do you handle getting back a single selected value in your view model?  

Whenever I have dropdown lists, it seems I can pass a model to the view but I can&#039;t use the model to get the postback data as the fields that are the lists return null values.  Help me Obiwan, you&#039;re my only hope!</description>
		<content:encoded><![CDATA[<p>Piggybacking on Vaibhav&#8217;s question:  Suppose you have a collection that you are passing to the view to populate a dropdown list.  Your view takes in a collection/list but the view should return a selected value from that list.  How do you handle getting back a single selected value in your view model?  </p>
<p>Whenever I have dropdown lists, it seems I can pass a model to the view but I can&#8217;t use the model to get the postback data as the fields that are the lists return null values.  Help me Obiwan, you&#8217;re my only hope!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Richard</title>
		<link>http://richarddingwall.name/2009/03/02/domain-entities-vs-presentation-model-objects-part-2-mapping/comment-page-1/#comment-55871</link>
		<dc:creator>Richard</dc:creator>
		<pubDate>Tue, 31 Jan 2012 19:56:07 +0000</pubDate>
		<guid isPermaLink="false">http://richarddingwall.name/?p=1022#comment-55871</guid>
		<description>@Vaibhav: the presentation view model class would have a collection too.</description>
		<content:encoded><![CDATA[<p>@Vaibhav: the presentation view model class would have a collection too.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Richard</title>
		<link>http://richarddingwall.name/2009/03/02/domain-entities-vs-presentation-model-objects-part-2-mapping/comment-page-1/#comment-55870</link>
		<dc:creator>Richard</dc:creator>
		<pubDate>Tue, 31 Jan 2012 19:43:38 +0000</pubDate>
		<guid isPermaLink="false">http://richarddingwall.name/?p=1022#comment-55870</guid>
		<description>Presentation view model class would have a collection too.</description>
		<content:encoded><![CDATA[<p>Presentation view model class would have a collection too.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Vaibhav</title>
		<link>http://richarddingwall.name/2009/03/02/domain-entities-vs-presentation-model-objects-part-2-mapping/comment-page-1/#comment-55843</link>
		<dc:creator>Vaibhav</dc:creator>
		<pubDate>Tue, 31 Jan 2012 11:27:50 +0000</pubDate>
		<guid isPermaLink="false">http://richarddingwall.name/?p=1022#comment-55843</guid>
		<description>In a case where a business entity has a collection of another business entity. How would I manage the presentation entity. In this case I can&#039;t  have a flattered presentation entity.</description>
		<content:encoded><![CDATA[<p>In a case where a business entity has a collection of another business entity. How would I manage the presentation entity. In this case I can&#8217;t  have a flattered presentation entity.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

