public void SaveObservedChanges(IBrowsableDataObject plainObject) { foreach (var change in Changes) { TcOpen.Inxton.TcoAppDomain.Current.Logger.Information($"User '{change.UserName}' changed value of '{change.ValueTag.Symbol}' from '{change.OldValue}' to '{change.NewValue}' {{@payload}}", change); } if (DataObject.Changes == null) { DataObject.Changes = new List <ValueChangeItem>(); } Changes.AddRange(DataObject.Changes); ((IPlainTcoEntity)plainObject).Changes.AddRange(Changes); Changes = new List <ValueChangeItem>(); }
public void Import(IBrowsableDataObject plainObject) { var startImportTag = new ValueChangeItem() { DateTime = DateTime.Now, UserName = GetUser(), NewValue = "-Import start-", OldValue = "-Import start-" }; var endImportTag = new ValueChangeItem() { DateTime = DateTime.Now, UserName = GetUser(), NewValue = "-Import end-", OldValue = "-Import end-" }; ((IPlainTcoEntity)plainObject).Changes.Add(startImportTag); SaveObservedChanges(plainObject); ((IPlainTcoEntity)plainObject).Changes.Add(endImportTag); }