I'm currently updating a single property on a file (called "Website Link"). As this is updated by an automated event I don't also want to update the file metadata in the process. At the moment I'm doing this by capturing the modified and modified in variables and then saving it back to the item before I do UpdateOverwriteversion()
- it makes for some confusing code though. For example:
var spFile = web.GetListItem(_listUrl + item.Name);
var currentModified = spFile["Modified"];
var currentModifiedBy = spFile["Modified By"];
spFile["Website Link"] = hyperlink;
spFile["Modified"] = currentModified;
spFile["Modified By"] = currentModifiedBy;
spFile.UpdateOverwriteVersion();
Surely there's a better way than this?