adamfoneil / Dapper.CX

A Crud library based on Dapper
MIT License
8 stars 1 forks source link

add Delete overload that accepts a model, not just TIdentity #20

Closed adamfoneil closed 4 years ago

adamfoneil commented 4 years ago

This came up in my Blazor demo when I was implementing the Delete behavior on the Folders page. When you delete a folder, you need to cascade delete its children as well. (Of course, this assumes there's no FK ref in the way, but that's irrelevant to this issue. An FK would simply block the delete.) I can implement the cascade delete via ITrigger but I have no way to report back to the UI what child records were deleted. This is important for refreshing the folder list. I created a property to hold the deleted rowIds, but this isn't in scope during the delete operation.

I was thinking what I need is a Delete overload that accepts a model instance so that unique state data will be visible to callers.