How do you get Linq to Sql to do pre and post actions beside just updating the records? I’m trying to setup a type 4 slowly changing dimension as described here.
tbl_emplyees
Id Name HourlyWage
--------------------------
1 Bob 30
2 Dan 20
tbl_emplyees_history
Id CreatedDate Name HourlyWage
----------------------------------------------
1 4/2/2012 Bob 10
1 4/3/2012 Bob 20
2 2/2/2012 Dan 10
So, what I’d need to happen is, before any records are updated, they need to be copied into a history table.
I looked into stored procedures, but there seems to be a disconnect there. Linq is brilliant that it can submit modified records automagically but there doesn’t appear to be a way to pass all modified records into a stored procedure that achieves parity and allows pre and post actions with the same ease.
What “Disconnect” are you seeing with stored procs? LINQ to SQL has pretty good support for stored procs.
Alternatively, have you considered triggers for the auditing?