private void AddRecordToPrimaryKeysLookup <T>(EntityRecord record) { var primaryKeyCombo = new RecordKeyCombo(record.PrimaryKeyValues.ToList()); try { PrimaryKeys.Add(primaryKeyCombo, record); } catch (Exception ex) { throw new Exception(string.Format("An item of type {0} already exists for primary keys '{1}' with value(s): {2}.", typeof(T).Name, StringHelper.GetDelimitedString(record.AssociatedEntityBatch.EntityDefinition.PrimaryKeyColumnNames), primaryKeyCombo.ToString()), ex); } }
private void AddRecordToSecondaryKeysLookup <T>(EntityRecord record) { var secondaryKeys = record.SecondaryKeyValues; if (secondaryKeys != null && secondaryKeys.Count > 0) { var secondaryKeyCombo = new RecordKeyCombo(secondaryKeys); try { SecondaryKeys.Add(secondaryKeyCombo, record); } catch (Exception ex) { throw new Exception(string.Format("An item of type {0} already exists for secondary keys '{1}' with value(s): {2}.", typeof(T).Name, StringHelper.GetDelimitedString(record.AssociatedEntityBatch.EntityDefinition.PrimaryKeyColumnNames), secondaryKeyCombo.ToString()), ex); } } }