last day (15 days later) » 

11:54 PM
1
A: How to PATCH in Web API and OData

michael mooreI'm not sure what you're trying to achieve is possible. At least not with Delta<TEntity>.Patch(..) Assuming that you have Product entity and somewhere in your PATCH action you have [AcceptVerbs("PATCH")] public void Patch(int productId, Delta<Product> product) { var productFromDb = // get p...

 
Thanks for your answer! I had the feeling using reflector could be helpful here... So is this a bug? Because the spec and MSDN both talk about "instructions" not values. So what's the difference between Delta.Put and Delta.Patch? By the way, do you work at Microsoft or "only" an enthusiastic programmer?
 
@gdoron are you talking about MSDN for Delta's Patch method?
@gdoron you would probably be surprised, but Delta's PUT method doesn't differ that much, the only difference is that in PUT method it also goes thru the unchanged properties list and just copies those values also. And no, I don't work in MS :) Btw, just as a side note - I've used IlSpy not reflector :)
 
yes, I am taking about the MSDN for patch.
 
@gdoron as you mentioned in post - it just says it overwrites original entity with the changes tracked by Delta. You saw how Delta tracks changes, it doesn't look for instructions and nowhere in MSDN I could find any word about instructions. I agree with you thou, RFC spec talks about instructions.
 
So are you saying that Delta.Put doesn't partial update the entity but override the entity completely just like simple Http put method?!
 
11:54 PM
Yes, this is the signature of PUT method
public void Put(TEntityType original)
{
this.CopyChangedValues(original);
this.CopyUnchangedValues(original);
}
For comparison you can check Patch method
public void Patch(TEntityType original)
{
this.CopyChangedValues(original);
}
 
Hi Michael! First thanks for your answer!
 
yes sure, my pleasure
 
This is just sad...
 

  last day (15 days later) »