Bulk Collection Manipulation through a REST (RESTful) API

后端 未结 7 732
我寻月下人不归
我寻月下人不归 2020-12-04 06:45

I\'d like some advice on designing a REST API which will allow clients to add/remove large numbers of objects to a collection efficiently.

Via the API, clients need

7条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-04 07:22

    Best way is :

    Pass Only Id Array of Deletable Objects from Front End Application To Web API
        2. Then You have Two Options: 
           2.1 Web API Way : Find All Collections/Entities using Id arrays and Delete in API , but you need to take care of Dependant entities like Foreign Key Relational Table Data too
         2.2. Database Way : Pass Ids to your database side, find all records in Foreign Key Tables and Primary Key Tables and Delete in same order i.e. F-Key Table records then P-Key Table records
    

提交回复
热议问题