public async Task SaveAsync(ApplicationDatabase applicationDatabase)
{
var messages = new StringBuilder();
if (ValidateModel(messages))
{
// Prefer to use the file name from the applicationDatabase in case it has been changed upstream.
await this.ruleRepository.SaveAsync(MatchingRules, applicationDatabase.FullPath(applicationDatabase.MatchingRulesCollectionStorageKey), applicationDatabase.IsEncrypted);
}
else
{
throw new ValidationWarningException("Unable to save matching rules at this time, some data is invalid.\n" + messages);
}
this.monitorableDependencies.NotifyOfDependencyChange<ITransactionRuleService>(this);
Saved?.Invoke(this, EventArgs.Empty);
}