Beispiel #1
0
        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);
        }
Beispiel #2
0
 public SnapshotChangesTrackerFor(TModel model, SemaphoreSlim semaphoreSlim)
 {
     ModelSnapshot  = Snaphsot.From(model);
     _semaphoreSlim = semaphoreSlim;
 }