/// <summary>
        /// Attempt to clean up any resources used by the repository
        /// </summary>
        /// <param name="repository">The repository instance that we created</param>
        private async Task DisposeRepositoryAsync(ICharacterSetRepository repository)
        {
            if (repository is IAsyncDisposable asyncDisposable)
            {
                await asyncDisposable.DisposeAsync().ConfigureAwait(false);

                GC.SuppressFinalize(this);
                return;
            }
            if (repository is IDisposable disposable)
            {
                disposable.Dispose();
                GC.SuppressFinalize(this);
                return;
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// Load the internal list from the underlying data source
        /// </summary>
        /// <param name="repository">The repository from which to load the data</param>
        internal async Task LoadListAsync(ICharacterSetRepository repository)
        {
            IList <CharacterSetDTO> items = await repository.FetchListAsync().ConfigureAwait(false);

            await LoadObjectsAsync(items);
        }