Ejemplo n.º 1
0
 void AddError(Error error, List <Error> errorList)
 {
     if (ThrowExceptionIfNotValid)
     {
         throw SDMXValidationException.Create(new List <Error> {
             error
         }, error.Message);
     }
     else
     {
         errorList.Add(error);
     }
 }
Ejemplo n.º 2
0
        /// <summary>
        /// Writes the record in the form of string, object dictionary.
        /// </summary>
        /// <param name="record">The record to write.</param>
        public void WriteRecord(Dictionary <string, object> record)
        {
            CheckDisposed();

            Dictionary <string, string> values = null;
            var errors = _validator.ValidateRecord(record, out values);

            if (errors.Count > 0)
            {
                throw SDMXValidationException.Create(errors, string.Format("Invalid record: {0}. See Errors property for details:", RecordToString(record)));
            }

            WriteRecord(values);
        }