BudgetAnalyser.Engine.Services.TransactionManagerService.LoadAsync C# (CSharp) Method

LoadAsync() public method

Loads a data source with the provided database reference data asynchronously.
Statement Model data is corrupt and has been tampered with. Unable to load.
public LoadAsync ( ApplicationDatabase applicationDatabase ) : System.Threading.Tasks.Task
applicationDatabase BudgetAnalyser.Engine.Persistence.ApplicationDatabase
return System.Threading.Tasks.Task
        public async Task LoadAsync(ApplicationDatabase applicationDatabase)
        {
            if (applicationDatabase == null)
            {
                throw new ArgumentNullException(nameof(applicationDatabase));
            }

            StatementModel?.Dispose();
            try
            {
                StatementModel = await this.statementRepository.LoadAsync(applicationDatabase.FullPath(applicationDatabase.StatementModelStorageKey), applicationDatabase.IsEncrypted);
            }
            catch (StatementModelChecksumException ex)
            {
                throw new DataFormatException("Statement Model data is corrupt and has been tampered with. Unable to load.", ex);
            }

            NewDataAvailable();
        }