Delete multiple rows in database table

I have a database table that I have crud pages set up for. When the table is updated via the 'Add' Crud page, I have it set up to add 2 rows to another table (a summary table that holds data for a dashboard grid). I have been able to set up the add and edit pages to properly add or edit these summary records but I am also trying to set up the 'Delete' button on the Crud main page to delete those summary records when the main record is deleted. Can seem to figure it out.

Main table is called deals and the summary table is called dealsummary. In the deals table I have a column called DealDMSID and in the summary records I have a column called DealSummaryDMSID. I am trying to add code in the Click event of the delete button on the datagrid. I have looked at all the information I can find on linq and iqueryable and am at a loss. Tried to invoke a datasource after the dealDelete method using the common DMSID with no luck.

If I invoke the datasource for dealsummary and filter based on DealSummaryDMSID = DealDMSID, what C# code works to delete those rows? I tried DeleteAllOnSubmit, RemoveRange, etc..

I think the following is close to what I need, but still can't make it work..

${result.Where(x => x.SummaryDMSID == StoreDealDMSID).Delete()}

StoreDealDMSID is just a propery set to Deals.DealDMSID} so it doesn't get lost in the delete.

Thanks for looking.

Check this thread for more info:

There are several versions of this example, plus a few others I have looked at. RemoveRange seems to be the right way to go, but no matter how I set it up (as a custom method or as C#) I get the same error.

'IQueryable' does not contain a definition for 'RemoveRange' and no accessible extension method 'RemoveRange' accepting a first argument of type 'IQueryable' could be found

I have tried several other ways as well, using Delete(), DeleteAllOnSubmit() and others...in every case, the error is the same

'IQueryable' does not contain a definition for XXX on any option I try.

Am I missing an include statement? When I debug with Visual Studio, those options are not available in the IQueryable command...

You might missing Microsoft.EntityFrameworkCore: