protected virtual void DoAudit() { if (!loggingInitialized) { var logTableAttr = typeof(TRow).GetCustomAttribute <CaptureLogAttribute>(); if (logTableAttr != null) { captureLogHandler = new CaptureLogHandler <TRow>(); } hasAuditLogAttribute = Row.IdField.IsIntegerType && typeof(TRow).GetCustomAttribute <AuditLogAttribute>(false) != null; loggingInitialized = true; } if (captureLogHandler != null) { DoCaptureLog(); } else if (hasAuditLogAttribute) { DoGenericAudit(); } }