Esempio n. 1
0
        public void Add(ReferenceTableInfo referenceTableInfo)
        {
            ExceptionUtils.DisallowNullArgument <ReferenceTableInfo>(referenceTableInfo, "referenceTableInfo");

            string existingTableType;

            lock (_syncObject)
            {
                if (CheckIfTableExists(referenceTableInfo, out existingTableType))
                {
                    throw new SchemaInfoException(
                              SchemaInfoErrorCode.TableInfoAlreadyPresent,
                              Errors._SchemaInfo_TableInfoAlreadyExists,
                              existingTableType,
                              referenceTableInfo.SchemaName,
                              referenceTableInfo.TableName);
                }

                bool result = _referenceTables.Add(referenceTableInfo);
                // Adding to the reference table set shouldn't fail since we have done all necessary
                // verification apriori.
                Debug.Assert(result, "Addition of new sharded table info failed.");
            }
        }
Esempio n. 2
0
 /// <summary>
 /// Removes information about a reference table.
 /// </summary>
 /// <param name="referenceTableInfo">Reference table info.</param>
 public bool Remove(ReferenceTableInfo referenceTableInfo)
 {
     return(_referenceTables.Remove(referenceTableInfo));
 }