public async void SaveModel()
        {
            // Notifies subscribers that Save is about to start
            SaveBegins?.Invoke();

            await _movieCatalog.SaveAsync();

            await _studioCatalog.SaveAsync();

            // Notifies subscribers that Save is about to end
            SaveEnds?.Invoke();
        }
Ejemplo n.º 2
0
        public async void SaveModel()
        {
            SaveBegins?.Invoke();

            await _carCatalog.SaveAsync();

            await _customerCatalog.SaveAsync();

            await _employeeCatalog.SaveAsync();

            await _saleCatalog.SaveAsync();

            SaveEnds?.Invoke();
        }
Ejemplo n.º 3
0
        /// <inheritdoc />
        /// <summary>
        /// Relays call of Save to data source, if the data
        /// source supports the Load operation
        /// </summary>
        public async Task SaveAsync(bool suppressException = true)
        {
            if (_supportedOperations.Contains(PersistencyOperations.Save))
            {
                SaveBegins?.Invoke();
                await _persistentSource.Save(CreatePersistentDataObjects(_collection.All));

                SaveEnds?.Invoke();
            }
            else
            {
                if (!suppressException)
                {
                    throw new NotSupportedException();
                }
            }
        }