summaryrefslogtreecommitdiff
path: root/product/database/transactions/ObjectDatabaseCommandRegistry.cs
blob: 8b2d97ec89fadabeeceb5ca320037acf209d01de (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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);
        }
    }
}