<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://forums.asp.net/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>ASP.NET MVC</title><link>http://forums.asp.net/1146.aspx</link><description>Discussions regarding Model-View-Controller (MVC) support in ASP.NET.  &lt;a href="http://forums.asp.net/1215.aspx"&gt;T4MVC subforum&lt;/a&gt;</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP1 (Build: 20510.895)</generator><item><title>Re: UpdateFrom in MVC Preview 2</title><link>http://forums.asp.net/thread/3495589.aspx</link><pubDate>Thu, 05 Nov 2009 08:48:36 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3495589</guid><dc:creator>levib</dc:creator><author>levib</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/3495589.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1146&amp;PostID=3495589</wfw:commentRss><description>&lt;p&gt;MVC 2 Preview 2 model binders have built-in support for properties of type byte[] and System.Linq.Binary.&amp;nbsp; I recommend using one of those instead of the UpdateFrom() extension method.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;BTW - This thread is a year and half old.&amp;nbsp; Please open a new thread if you have additional questions, or else they&amp;#39;re likely to be overlooked by the community.&lt;br /&gt;&lt;/p&gt;</description></item><item><title>Re: UpdateFrom in MVC Preview 2</title><link>http://forums.asp.net/thread/3495150.aspx</link><pubDate>Thu, 05 Nov 2009 03:03:58 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3495150</guid><dc:creator>quentins</dc:creator><author>quentins</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/3495150.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1146&amp;PostID=3495150</wfw:commentRss><description>&lt;p&gt;I was hoping MVC 2 would have fixed the problem with TimeStamps.&amp;nbsp; Using either:&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;pre name="code" class="c-sharp"&gt;BindingHelperExtensions.UpdateFrom(e_UserAccount, Request.Form);&lt;/pre&gt; &lt;p&gt;or&lt;/p&gt;&lt;p&gt;e_UserAccount.UpdateFrom(Request.Form);&lt;/p&gt;&lt;p&gt;They both blow up with an exception:&lt;/p&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp; No type converter available for type: System.Byte[]&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;So a secondary question would be how do you add additional type converters especially one for byte[]&lt;br /&gt;&lt;/p&gt;</description></item><item><title>Re: UpdateFrom in MVC Preview 2</title><link>http://forums.asp.net/thread/2231850.aspx</link><pubDate>Thu, 13 Mar 2008 22:04:42 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:2231850</guid><dc:creator>katokay</dc:creator><author>katokay</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/2231850.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1146&amp;PostID=2231850</wfw:commentRss><description>&lt;p&gt;&amp;nbsp;http://www.hanselman.com/blog/ImJustACavemanTheHanselmanCorollaryToTheClarkeWheelerLaws.aspx &lt;/p&gt;&lt;p&gt;Yes, I agree it has a nice ring to it. &lt;img src="http://forums.asp.net/emoticons/emotion-2.gif" alt="Big Smile" /&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: UpdateFrom in MVC Preview 2</title><link>http://forums.asp.net/thread/2228039.aspx</link><pubDate>Wed, 12 Mar 2008 12:50:26 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:2228039</guid><dc:creator>kombatsanta</dc:creator><author>kombatsanta</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/2228039.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1146&amp;PostID=2228039</wfw:commentRss><description>&lt;p&gt;Hmmm... yeah. That worked for my Create method:&lt;/p&gt;&lt;font size="2"&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;public&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;void&lt;/font&gt;&lt;font size="2"&gt; Create()&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;{&lt;/p&gt;&lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;Product&lt;/font&gt;&lt;font size="2"&gt; product = &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;new&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;Product&lt;/font&gt;&lt;font size="2"&gt;();&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;&lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;BindingHelperExtensions&lt;/font&gt;&lt;font size="2"&gt;.UpdateFrom(product, Request.Form);&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;northwind.AddProduct(product);&lt;/p&gt;
&lt;p&gt;northwind.SubmitChanges();&lt;/p&gt;RedirectToAction(&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;&amp;quot;List&amp;quot;&lt;/font&gt;&lt;font size="2"&gt;);&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;But in my Add method I still have to do this:&lt;/p&gt;&lt;font color="#0000ff" size="2"&gt;public&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;void&lt;/font&gt;&lt;font size="2"&gt; Update(&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;int&lt;/font&gt;&lt;font size="2"&gt; id, &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;string&lt;/font&gt;&lt;font size="2"&gt; ProductName, &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;int&lt;/font&gt;&lt;font size="2"&gt; CategoryID, &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;int&lt;/font&gt;&lt;font size="2"&gt; SupplierID, &lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;Decimal&lt;/font&gt;&lt;font size="2"&gt; UnitPrice)&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;{&lt;/p&gt;&lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;Product&lt;/font&gt;&lt;font size="2"&gt; product = northwind.GetProductById(id);&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;&lt;/font&gt;&lt;font color="#008000" size="2"&gt;product.ProductName = ProductName;&lt;/font&gt;&lt;/font&gt;&lt;font color="#008000" size="2"&gt; 
&lt;p&gt;product.CategoryID = CategoryID;&lt;/p&gt;
&lt;p&gt;product.SupplierID = SupplierID;&lt;/p&gt;
&lt;p&gt;product.UnitPrice = UnitPrice;&lt;/p&gt;&lt;/font&gt;&lt;font size="2"&gt;northwind.SubmitChanges();&lt;/font&gt;&lt;font size="2"&gt;RedirectToAction(&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;&amp;quot;List&amp;quot;&lt;/font&gt;&lt;font size="2"&gt;);&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;instead of this:&lt;/p&gt;&lt;font color="#0000ff" size="2"&gt;public&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;void&lt;/font&gt;&lt;font size="2"&gt; Update(&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;int&lt;/font&gt;&lt;font size="2"&gt; id&lt;/font&gt;&lt;font size="2"&gt;)&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;{&lt;/p&gt;&lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;Product&lt;/font&gt;&lt;font size="2"&gt; product = northwind.GetProductById(id);&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;&lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;BindingHelperExtensions&lt;/font&gt;&lt;font size="2"&gt;.UpdateFrom(product, Request.Form);&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;northwind.SubmitChanges();&lt;/p&gt;RedirectToAction(&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;&amp;quot;List&amp;quot;&lt;/font&gt;&lt;font size="2"&gt;);&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;</description></item><item><title>Re: UpdateFrom in MVC Preview 2</title><link>http://forums.asp.net/thread/2227810.aspx</link><pubDate>Wed, 12 Mar 2008 11:02:17 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:2227810</guid><dc:creator>nicosabena</dc:creator><author>nicosabena</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/2227810.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1146&amp;PostID=2227810</wfw:commentRss><description>&lt;p&gt;It seems that you just need to change the line:&lt;/p&gt;&lt;p&gt;&lt;font&gt;&lt;font size="2"&gt;product.UpdateFrom(Request.Form);&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;to:&lt;/p&gt;&lt;p&gt;&lt;font color="#2b91af" size="2"&gt;BindingHelperExtensions&lt;/font&gt;&lt;font size="2"&gt;.UpdateFrom(product, Request.Form);&lt;/font&gt;&lt;font size="2"&gt;&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;/font&gt;&amp;nbsp;&lt;/p&gt;&lt;/font&gt;&lt;/p&gt;</description></item><item><title>Re: UpdateFrom in MVC Preview 2</title><link>http://forums.asp.net/thread/2227570.aspx</link><pubDate>Wed, 12 Mar 2008 09:17:26 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:2227570</guid><dc:creator>kombatsanta</dc:creator><author>kombatsanta</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/2227570.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1146&amp;PostID=2227570</wfw:commentRss><description>&lt;p&gt;So how would be the &amp;quot;correct&amp;quot; way to update an object? I mean instead of doing the following:&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;font color="#0000ff" size="2"&gt;public&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;void&lt;/font&gt;&lt;font size="2"&gt; Create()&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;{&lt;/p&gt;&lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;Product&lt;/font&gt;&lt;font size="2"&gt; product = &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;new&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;Product&lt;/font&gt;&lt;font size="2"&gt;();&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;product.UpdateFrom(Request.Form);&lt;/p&gt;
&lt;p&gt;northwind.AddProduct(product);&lt;/p&gt;
&lt;p&gt;northwind.SubmitChanges();&lt;/p&gt;RedirectToAction(&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;&amp;quot;List&amp;quot;&lt;/font&gt;&lt;font size="2"&gt;);&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;You would do it like?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;/font&gt;</description></item><item><title>Re: UpdateFrom in MVC Preview 2</title><link>http://forums.asp.net/thread/2226752.aspx</link><pubDate>Tue, 11 Mar 2008 22:08:14 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:2226752</guid><dc:creator>robconery</dc:creator><author>robconery</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/2226752.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1146&amp;PostID=2226752</wfw:commentRss><description>&lt;p&gt;I like it - very nice - perhaps Request.Serialize() and Request.Deserialize(). This is why Phil and Eilon love me... I feel some proto-code coming...&lt;br /&gt;&lt;/p&gt;</description></item><item><title>Re: UpdateFrom in MVC Preview 2</title><link>http://forums.asp.net/thread/2225560.aspx</link><pubDate>Tue, 11 Mar 2008 13:39:29 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:2225560</guid><dc:creator>katokay</dc:creator><author>katokay</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/2225560.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1146&amp;PostID=2225560</wfw:commentRss><description>&lt;p&gt;&amp;nbsp;Seems like it might be nice as Request.Form.DeserializeTo, Which would also allow for Request.QueryString.DeserializeTo, etc.&lt;br /&gt;&lt;/p&gt;</description></item><item><title>Re: UpdateFrom in MVC Preview 2</title><link>http://forums.asp.net/thread/2224289.aspx</link><pubDate>Tue, 11 Mar 2008 02:55:23 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:2224289</guid><dc:creator>robconery</dc:creator><author>robconery</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/2224289.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1146&amp;PostID=2224289</wfw:commentRss><description>&lt;p&gt;&amp;nbsp;One of the things we wanted to do was move away from hanging any extensions off of Object (which is where UpdateFrom() used to live). It&amp;#39;s now located in System.Web.Mvc.BindingHelperExtensions (which I think will get renamed) as a static method).&lt;br /&gt;&lt;/p&gt;</description></item><item><title>UpdateFrom in MVC Preview 2</title><link>http://forums.asp.net/thread/2224133.aspx</link><pubDate>Tue, 11 Mar 2008 00:24:41 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:2224133</guid><dc:creator>AlexBecker</dc:creator><author>AlexBecker</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/2224133.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1146&amp;PostID=2224133</wfw:commentRss><description>&lt;p&gt;What happened to UpdateFrom in Preview 2?. How come it&amp;#39;s not an extension method anymore? :S&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Thx&amp;nbsp;&lt;/p&gt;</description></item></channel></rss>