コード例 #1
0
        public async void SaveModel()
        {
            SaveBegins?.Invoke();

            await _employeeCatalog.SaveAsync();

            //await _stationCatalog.SaveAsync();

            SaveEnd?.Invoke();
        }
コード例 #2
0
        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();
        }
コード例 #3
0
        public async void SaveModel()
        {
            SaveBegins?.Invoke();

            await _carCatalog.SaveAsync();

            await _customerCatalog.SaveAsync();

            await _employeeCatalog.SaveAsync();

            await _saleCatalog.SaveAsync();

            SaveEnds?.Invoke();
        }
コード例 #4
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();
                }
            }
        }