One of my pages contains a grid that is bound to a typed view, where I added an unbound checkbox column in order for the user to check which rows they would like to add or delete. Basically, when the user hits the save button, I need to loop through all the grid rows and figure out which ones are checked, which means I need to insert a record into some other table, and whichever ones were are not checked, go ahead and delete the row from the table. I'm using a typed view because I am pulling data from multiple database and making sql function calls in the query, so I am not able to bind the grid to an entity collection. I'm trying to figure out which Save and Delete adapter methods to use in this scenario. For my adds, I could either loop through the checked rows and create a new entity for each row and save them independently. Or I could also loop through the checked rows and build an entity, add it to an entity collection, and invoke a SaveEntityCollection().
Now, for the deletes, I could either delete each entity one at a time, or I could create an entity for each entity to delete, add it to an entity collection, then call the DeleteEntityCollection() method. Also, I think my last option would be to call the delete directly against the adapter, where I could build my predicate expression with all the id's right in there: (DELETE FROM tbl_MyTable WHERE (ID = 0 OR ID = 1 OR ID = 2...)
Anyone have any ideas on which route I should go with?
Thanks!