using SharedLibraryCore.Interfaces; using System; using System.Collections.Generic; using System.Text; namespace SharedLibraryCore.Helpers { /// /// This class provides a way to keep track of changes to an entity /// /// Type of entity to keep track of changes to public class ChangeTracking { List Values; public ChangeTracking() { Values = new List(); } public void OnChange(T value) { // clear the first value when count max count reached if (Values.Count > 30) Values.RemoveAt(0); Values.Add(value); } public List GetChanges() => Values; } }