public bool IsChanged(TModel model) { TModel snapshot = default; try { _semaphoreSlim.Wait(); snapshot = Snaphsot.From(model); } finally { _semaphoreSlim.Release(); } if (Changes.Between(ModelSnapshot, snapshot) == null) { return(false); } ModelSnapshot = snapshot; return(true); }
public SnapshotChangesTrackerFor(TModel model, SemaphoreSlim semaphoreSlim) { ModelSnapshot = Snaphsot.From(model); _semaphoreSlim = semaphoreSlim; }