/// <summary>
 /// Add factor field enum values to the data identifier list.
 /// </summary>
 /// <param name='factorFieldEnumValues'>Factor field enum values.</param>
 public void AddRange(FactorFieldEnumValueList factorFieldEnumValues)
 {
     if (factorFieldEnumValues.IsNotEmpty())
     {
         foreach (FactorFieldEnumValue factorFieldEnumValue in factorFieldEnumValues)
         {
             Add(factorFieldEnumValue);
         }
     }
 }
Пример #2
0
        /// <summary>
        /// Get a subset of the Factor Field Enum Value List object with specified factor field enum id
        /// </summary>
        /// <param name="factorFieldEnumId">Factor Field Enum Id</param>
        /// <exception cref="ArgumentException">Thrown if no data has the requested id.</exception>
        /// <returns>A list of Factor Field Enum Values</returns>
        public FactorFieldEnumValueList GetSubSetByEnumId(Int32 factorFieldEnumId)
        {
            FactorFieldEnumValueList factorFieldEnumValues = new FactorFieldEnumValueList();

            foreach (FactorFieldEnumValue factorFieldEnumValue in this)
            {
                if (factorFieldEnumValue.FactorFieldEnumId == factorFieldEnumId)
                {
                    factorFieldEnumValues.Add(factorFieldEnumValue);
                }
            }

            if (factorFieldEnumValues.Count > 0)
            {
                return(factorFieldEnumValues);
            }

            // No data found with requested id.
            throw new ArgumentException("No data with id " + factorFieldEnumId + "!");
        }