Example #1
0
        public async Task <bool> RemoveAsync(string carId, string trackId)
        {
            await EnsureActualAsync();

            if (!_storage.Remove(carId, trackId))
            {
                return(false);
            }

            SetDirty();

            if (_readerFunc != null)
            {
                using (var reader = _readerFunc()) {
                    await Task.Run(() => reader.Remove(carId, trackId));

                    _storage.SyncLastModified(reader);
                }
            }

            OnPropertyChanged(nameof(LastModified));
            OnPropertyChanged(nameof(EntriesCount));
            return(true);
        }