AuditInsert() public static method

public static AuditInsert ( IDbConnection connection, string schema, Serenity.Services.AuditSaveRequest request ) : void
connection IDbConnection
schema string
request Serenity.Services.AuditSaveRequest
return void
        protected virtual void DoGenericAudit()
        {
            var auditFields = new HashSet <Field>();

            GetEditableFields(auditFields);

            var auditRequest = GetAuditRequest(auditFields);

            if (IsUpdate)
            {
                Row audit = null;
                if (auditRequest != null)
                {
                    audit = AuditLogService.PrepareAuditUpdate(RowRegistry.GetConnectionKey(Row), auditRequest);
                }

                if (audit != null)
                {
                    Connection.Insert(audit);
                }
            }
            else if (IsCreate)
            {
                if (auditRequest != null)
                {
                    AuditLogService.AuditInsert(Connection, RowRegistry.GetConnectionKey(Row), auditRequest);
                }
            }
        }
        public override void OnAudit(ISaveRequestHandler handler)
        {
            if (handler.Row == null)
            {
                return;
            }

            var auditRequest = GetAuditSaveRequest(handler);

            if (connectionKey == null)
            {
                connectionKey = handler.Row.GetFields().ConnectionKey;
            }

            if (handler.IsCreate)
            {
                if (auditRequest != null)
                {
                    AuditLogService.AuditInsert(handler.UnitOfWork.Connection, connectionKey, auditRequest);
                }

                return;
            }

            Row audit = null;

            if (auditRequest != null)
            {
                audit = AuditLogService.PrepareAuditUpdate(connectionKey, auditRequest);
            }

            if (audit != null)
            {
                handler.UnitOfWork.Connection.Insert(audit);
            }
        }