Exemplo n.º 1
0
        private void AddAuditing(Mappings mappings)
        {
            var auditObjects = new List <IAuxiliaryDatabaseObject>();

            foreach (var table in mappings.IterateTables.Where(_tableFilter))
            {
                var auditTable = new AuditTable(
                    table, _namingStrategy, _columnSource);
                mappings.AddAuxiliaryDatabaseObject(auditTable);

                var insertTrigger = new AuditTrigger(table,
                                                     auditTable, _namingStrategy, TriggerActions.INSERT);
                mappings.AddAuxiliaryDatabaseObject(insertTrigger);

                var updateTrigger = new AuditTrigger(table,
                                                     auditTable, _namingStrategy, TriggerActions.UPDATE);
                mappings.AddAuxiliaryDatabaseObject(updateTrigger);

                var deleteTrigger = new AuditTrigger(table,
                                                     auditTable, _namingStrategy, TriggerActions.DELETE);
                mappings.AddAuxiliaryDatabaseObject(deleteTrigger);
            }
        }
Exemplo n.º 2
0
        private void AddAuditing(Mappings mappings)
        {
            var auditObjects = new List<IAuxiliaryDatabaseObject>();
              foreach (var table in mappings.IterateTables.Where(_tableFilter))
              {
            var auditTable = new AuditTable(
              table, _namingStrategy, _columnSource);
            mappings.AddAuxiliaryDatabaseObject(auditTable);

            var insertTrigger = new AuditTrigger(table,
              auditTable, _namingStrategy, TriggerActions.INSERT);
            mappings.AddAuxiliaryDatabaseObject(insertTrigger);

            var updateTrigger = new AuditTrigger(table,
              auditTable, _namingStrategy, TriggerActions.UPDATE);
            mappings.AddAuxiliaryDatabaseObject(updateTrigger);

            var deleteTrigger = new AuditTrigger(table,
              auditTable, _namingStrategy, TriggerActions.DELETE);
            mappings.AddAuxiliaryDatabaseObject(deleteTrigger);
              }
        }