internal void OnError(StreamingContext context, ErrorContext errorContext) { context.AssertNotNull(nameof(context)); errorContext.AssertNotNull(nameof(errorContext)); if (string.Equals(errorContext.Member.ToString(), nameof(ResourceType), StringComparison.OrdinalIgnoreCase)) { (errorContext.OriginalObject as AuditRecord).ResourceType = ResourceType.Undefined; errorContext.Handled = true; } else if (string.Equals(errorContext.Member.ToString(), nameof(OperationType), StringComparison.OrdinalIgnoreCase)) { (errorContext.OriginalObject as AuditRecord).OperationType = OperationType.Undefined; errorContext.Handled = true; } }