-
I want to implement a module that can audit SiteSettings's changes The plan is:
public async Task UpdateSiteSettingsAsync(ISite site)
{
var inputSettings = site as SiteSettings;
await GetChangeLog(inputSettings);
await _documentManager.UpdateAsync(inputSettings);
}
private async Task<JObject> GetChangeLog(SiteSettings inputSettings)
{
//
var settingsFromDb = await _service.LoadSiteSettingsAsync();
var changedList = new Dictionary<string, JToken>();
foreach (var property in inputSettings.Properties)
{
if (!settingsFromDb.Properties.ContainsKey(property.Key))
{
changedList.Add(property.Key, property.Value);
}
else
{
var currentProp = settingsFromDb.Properties.SelectToken(property.Key);
if (!JToken.DeepEquals(property.Value, currentProp))
{
changedList.Add(property.Key, property.Value);
}
}
}
return null;
} But now there have a problem: The Can't get pre update data? Maybe I realized it in the wrong way? |
Beta Was this translation helpful? Give feedback.
Answered by
hyzx86
Dec 27, 2022
Replies: 2 comments
-
Done More appropriate through |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
hyzx86
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Done
More appropriate through
IContentHandler