/// <summary>
 /// Add AccountDictionaryRecordCondition to database
 /// </summary>
 /// <param name="instance">AccountDictionaryRecordCondition instance</param>
 /// <param name="accountDictionaryRecord">AccountDictionaryRecord instance for instance</param>
 /// <param name="saveAfterInsert">Save database after insertion</param>
 /// <param name="waitUntilSaving">Wait until saving</param>
 public void AccountDictionaryRecordConditionAdd(AccountDictionaryRecordCondition instance, AccountDictionaryRecord accountDictionaryRecord, bool saveAfterInsert = true, bool waitUntilSaving = true)
 {
     AccountDictionaryRecordConditionAdd(new AccountDictionaryRecordCondition[] { instance }, accountDictionaryRecord, saveAfterInsert, waitUntilSaving);
 }
 /// <summary>
 /// Remove AccountDictionaryRecordCondition from database
 /// </summary>
 /// <param name="instance">AccountDictionaryRecordCondition instance</param>
 /// <param name="saveAfterRemove">Save database after removing</param>
 /// <param name="waitUntilSaving">Wait until saving</param>
 public void AccountDictionaryRecordConditionRemove(AccountDictionaryRecordCondition instance, bool saveAfterRemove = true, bool waitUntilSaving = true)
 {
     AccountDictionaryRecordConditionRemove(new AccountDictionaryRecordCondition[] { instance }, saveAfterRemove, waitUntilSaving);
 }
        /// <summary>
        /// Create/Get new AccountDictionaryRecordCondition instance without any link to database
        /// </summary>
        /// <returns>AccountDictionaryRecordCondition instance</returns>
        public AccountDictionaryRecordCondition AccountDictionaryRecordConditionNew(AccountDictionaryRecord accountDictionaryRecord = null, uint? from = null, uint? to = null, bool? even = null)
        {
            try
            {
                var res = new AccountDictionaryRecordCondition()
                {
                    Even = even,
                    DictionaryRecord = accountDictionaryRecord,
                };

                if (from.HasValue)
                    res.From = from.Value;
                if (to.HasValue)
                    res.To = to.Value;
                if (accountDictionaryRecord != null)
                    accountDictionaryRecord.Conditions.Add(res);
                return res;
            }
            catch(Exception ex)
            {
                Helpers.Log.Add(ex, string.Format("Repository.AccountDictionaryRecordConditionNew()"));
                throw;
            }
        }