Abhijit Mondal Abhi
Abhijit Mondal Abhi

Reputation: 1829

How to hold all data from client side delete request in ASP.NET?

When I am hitting a request from client side to the API, following shows at the network as my URL Query String.

http://localhost:52713/api/ABCController/Delete/?id=488c3cd9-d134-4ca5-a947-085ee20cf0d5&id=e330055d-8c1d-4e85-8af7-11cae7c1c026&id=2ae09e11-fa20-409f-b780-1fc27a2a4d23&id=cd1a2bfb-dc9c-4c7a-8d42-25ed25613868&id=83256733-7fbe-4d94-b1a4-301a6197b3fb&id=7ac0f5c4-d87e-466c-9ab2-37084d142774&id=3cabf969-acab-46e5-ad86-4c41810178af&id=8205639b-19c6-47ba-b748-5332b1d04261&id=89345354-ea97-4465-bf3f-abf3d53ce05a&id=b84867df-92bc-485e-9a6b-d56b3efe089d&id=5465420a-9aa1-4f67-bba0-dbe6880e9f77&id=0b841b95-ed63-4e41-b0d3-e6d2321d1328

My Server Side Controller is as follows:

public Result<bool> Delete(Guid id)
        {
            return _ABCProductionRepo.Delete(id);
        }

I just received the 1st GUID ID from my request URL! I've also tried ArrayList instead of GUID type. But nothing happens.

Upvotes: 0

Views: 71

Answers (1)

William
William

Reputation: 107

Your Delete request is fine, however to accept an array in your controller you'll need to modify your parameter to an array and include [FromUri].

Delete([FromUri] Guid[] id)

Upvotes: 1

Related Questions