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.