Пример #1
0
 /// <summary>Finds a a ModelType record using a configuration and an external identifier.</summary>
 /// <param name="configurationId">Specified which mappings (user id columns) to use when looking up external identifiers.</param>
 /// <param name="externalId">The external identifier for the record.</param>
 public static int FindRequiredKey(object configurationId, string parameterId, string externalId)
 {
     // Look up the internal identifier using the configuration to select the ExternalId column and the external identifier to identify the record
     int internalId = ModelType.FindKey(configurationId, parameterId, externalId);
     if ((internalId == int.MinValue))
     {
         throw new Exception(string.Format("The ModelType table does not have a record identified by \'{0}\'", externalId));
     }
     // Return the internal identifier.
     return internalId;
 }
Пример #2
0
 /// <summary>Finds a a ModelType record using a configuration and an external identifier.</summary>
 /// <param name="configurationId">Specified which mappings (user id columns) to use when looking up external identifiers.</param>
 /// <param name="externalId">The external (user supplied) identifier for the record.</param>
 public static object FindOptionalKey(object configurationId, string parameterId, object externalId)
 {
     // Look up the internal identifier using the the configuration to specify which ExternalId column to use as an index.
     object internalId = null;
     if ((externalId != null))
     {
         internalId = ModelType.FindKey(configurationId, parameterId, ((string)(externalId)));
         if ((((int)(internalId)) == int.MinValue))
         {
             throw new Exception(string.Format("The ModelType table does not have a record identified by \'{0}\'", externalId));
         }
     }
     // Return the internal identifier.
     return internalId;
 }