A function to test each metadata property for a condition.
value
PropertyValue
A new value for the filtered properties.
Return Value
The number of affected properties.
Remarks
Please note that GroupDocs.Metadata implicitly checks the type of each filtered property. It’s impossible to update a property with a value having an inappropriate type.
Learn more
More examples demonstrating usages of this method: Updating metadata
Examples
using(Metadatametadata=newMetadata(Constants.InputXlsx)){if(metadata.FileFormat!=FileFormat.Unknown&&!metadata.GetDocumentInfo().IsEncrypted){// Update the file creation date/time if the existing value is older than 3 daysvaraffected=metadata.UpdateProperties(p=>p.Tags.Contains(Tags.Time.Created)&&p.Value.Type==MetadataPropertyType.DateTime&&p.Value.ToStruct<DateTime>()<threeDaysAgo,newPropertyValue(today));Console.WriteLine("Affected properties: {0}",affected);metadata.Save(Constants.OutputXlsx);}}