Last post Nov 05, 2009 08:48 AM by levib
Mar 11, 2008 01:24 AM|AlexBecker|LINK
What happened to UpdateFrom in Preview 2?. How come it's not an extension method anymore? :S
Mar 11, 2008 03:55 AM|robconery|LINK
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's now located in System.Web.Mvc.BindingHelperExtensions (which I think will get renamed) as a static method).
Mar 11, 2008 02:39 PM|katokay|LINK
Seems like it might be nice as Request.Form.DeserializeTo, Which would also allow for Request.QueryString.DeserializeTo, etc.
Mar 11, 2008 11:08 PM|robconery|LINK
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...
Mar 12, 2008 10:17 AM|kombatsanta|LINK
So how would be the "correct" way to update an object? I mean instead of doing the following:
You would do it like?
Mar 12, 2008 12:02 PM|nicosabena|LINK
It seems that you just need to change the line:
Mar 12, 2008 01:50 PM|kombatsanta|LINK
Hmmm... yeah. That worked for my Create method:
But in my Add method I still have to do this:
product.CategoryID = CategoryID;
product.SupplierID = SupplierID;
product.UnitPrice = UnitPrice;
instead of this:
Mar 13, 2008 11:04 PM|katokay|LINK
Yes, I agree it has a nice ring to it. [:D]
Nov 05, 2009 03:03 AM|quentins|LINK
I was hoping MVC 2 would have fixed the problem with TimeStamps. Using either:
They both blow up with an exception:
No type converter available for type: System.Byte
So a secondary question would be how do you add additional type converters especially one for byte
Nov 05, 2009 08:48 AM|levib|LINK
MVC 2 Preview 2 model binders have built-in support for properties of type byte and System.Linq.Binary. I recommend using one of those instead of the UpdateFrom() extension method.
BTW - This thread is a year and half old. Please open a new thread if you have additional questions, or else they're likely to be overlooked by the community.