public void RemoveProperties(PostedDataDto postedData) { string filePath = metadataConfiguration.GetAbsolutePath(postedData.guid); var tempFilePath = GetTempPath(filePath); using (MetadataContext context = new MetadataContext(filePath, postedData.password)) { foreach (var packageInfo in postedData.packages) { context.RemoveProperties(packageInfo.id, packageInfo.properties.Select(p => p.name)); } context.Save(tempFilePath); } DirectoryUtils.MoveFile(tempFilePath, filePath); }