summaryrefslogtreecommitdiff
path: root/product/database/transactions/ObjectDatabaseCommandRegistry.cs
diff options
context:
space:
mode:
Diffstat (limited to 'product/database/transactions/ObjectDatabaseCommandRegistry.cs')
-rw-r--r--product/database/transactions/ObjectDatabaseCommandRegistry.cs18
1 files changed, 18 insertions, 0 deletions
diff --git a/product/database/transactions/ObjectDatabaseCommandRegistry.cs b/product/database/transactions/ObjectDatabaseCommandRegistry.cs
new file mode 100644
index 0000000..8b2d97e
--- /dev/null
+++ b/product/database/transactions/ObjectDatabaseCommandRegistry.cs
@@ -0,0 +1,18 @@
+using System;
+using gorilla.commons.utility;
+
+namespace momoney.database.transactions
+{
+ public class ObjectDatabaseCommandRegistry : DatabaseCommandRegistry
+ {
+ public DatabaseCommand prepare_for_deletion<T>(T entity) where T : Identifiable<Guid>
+ {
+ return new DeleteFromDatabase<T>(entity);
+ }
+
+ public DatabaseCommand prepare_for_flushing<T>(T entity) where T : Identifiable<Guid>
+ {
+ return new SaveOrUpdateFromDatabase<T>(entity);
+ }
+ }
+} \ No newline at end of file