public ITypedElement AnonymizeElement(ITypedElement element, AnonymizerSettings settings = null) { EnsureArg.IsNotNull(element, nameof(element)); ElementNode resourceNode = ElementNode.FromElement(element); return(resourceNode.Anonymize(_rules, _processors)); }
public ITypedElement AnonymizeElement(ITypedElement element, AnonymizerSettings settings = null) { EnsureArg.IsNotNull(element, nameof(element)); try { ElementNode resourceNode = ParseTypedElementToElementNode(element); return(resourceNode.Anonymize(_rules, _processors)); } catch (AnonymizerProcessingException) { if (_configurationManager.Configuration.processingErrors == ProcessingErrorsOption.Skip) { // Return empty resource. return(new EmptyElement(element.InstanceType)); } throw; } }