/// <summary>
 /// Add AccountSettingsExportDirectory to database
 /// </summary>
 /// <param name="instance">AccountSettingsExportDirectory instance</param>
 /// <param name="settings">AccountSettings instance for shedule time</param>
 /// <param name="saveAfterInsert">Save database after insertion</param>
 /// <param name="waitUntilSaving">Wait until saving</param>
 public void AccountSettingsExportDirectoryAdd(AccountSettingsExportDirectory instance, AccountSettings settings, bool saveAfterInsert = true, bool waitUntilSaving = true)
 {
     AccountSettingsExportDirectoryAdd(new AccountSettingsExportDirectory[] { instance }, settings, saveAfterInsert, waitUntilSaving);
 }
 /// <summary>
 /// Remove AccountSettingsExportDirectory from database
 /// </summary>
 /// <param name="instance">AccountSettingsExportDirectory instance</param>
 /// <param name="saveAfterRemove">Save database after removing</param>
 /// <param name="waitUntilSaving">Wait until saving</param>
 public void AccountSettingsExportDirectoryRemove(AccountSettingsExportDirectory instance, bool saveAfterRemove = true, bool waitUntilSaving = true)
 {
     AccountSettingsExportDirectoryRemove(new AccountSettingsExportDirectory[] { instance }, saveAfterRemove, waitUntilSaving);
 }
        /// <summary>
        /// Create/Get new AccountSettingsExportDirectory instance without any link to database
        /// </summary>
        /// <returns>AccountSettingsExportDirectory instance</returns>
        public AccountSettingsExportDirectory AccountSettingsExportDirectoryNew(AccountSettings settings = null, object anonymousFiller = null)
        {
            try
            {
                var res = new AccountSettingsExportDirectory()
                {
                    Encoding = Encoding.Default,
                };

                if (anonymousFiller != null)
                    res.FillFromAnonymousType(anonymousFiller);

                if (settings != null)
                    settings.ExportDirectories.Add(res);
                return res;
            }
            catch(Exception ex)
            {
                Helpers.Log.Add(ex, string.Format("Repository.AccountSettingsExportDirectoryNew()"));
                throw;
            }
        }