I inherited a project that uses LLBLGen Pro for database level. For the database model, it is required that when deleting a record a flag (DeletedDate is set to the current time). The last programmer ignored this requirement and used regular deletions throughout the application.
Is there a way to set the code generator for this automatically, or do I need to overload each delete operator for objects that require it?
I implemented this in SQL Server 2005 using INSTEAD OF triggers to delete for any soft delete table. Triggers set the delete flag and perform a cleanup. The beauty of this solution is that it correctly handles deletes released by any system that accesses the database. INSTEAD OF is relatively new in SQL Server, I know there the equivalent of Oracle.
This solution goes well with our O / R mapper - I created views that filter out soft deleted records and display them. Views are also used for all reports.
You can create a custom task in LLBLGen that will override them for you when you create objects. Check out their templates and sample templates on the website.
, . SS , , .
, DataAccessAdapter , , .
, , "" - , selectvity "deleted" ( "" - , ), - .