Bulk Operations

Topics: Web Api
Jul 18, 2011 at 8:08 PM

Hi there,

I'm working on a project where this type of bulk operations are highly used. Things like select a bunch of records and approve them, or delete several records at a time.

For the update part I know there is a PATCH method and I was wondering if you are supporting it out of the box.

For the delete part, I need to be able to delete several records at a time. If I create a plural resource (something like Contacts _following the example in the samples project) and then add a list of ids in the body message; would that be considered a bad practice? Is there any better workaround out there? I can't deal with the latency of the by-record alternative.

Any comments are more than welcome!



Jul 18, 2011 at 8:17 PM

HI Raciel

1. We support methods like PATCH via web invoke but we don't provide any special implementation as web api really doesn't specify how your web api / handler methods are implemented. For patch you would annotate a method with [WebInvok(Method="PATCH")] and it should work fine.

2. In terms of deleting a batch of records through sending  a batch of ids via the content, i think that is a perfectly reasonable approach.


Jul 18, 2011 at 8:50 PM

Hi Glenn,

1) Is there any recommendation in terms of how the payload should look like for PATCH? Or should I go and take my own approach in terms of passing data that describes the entities to be affected as well the modifications on each case?

2) Cool, thanks!