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