コード例 #1
0
ファイル: DataReader.cs プロジェクト: tomplusit/sdmxdotnet
 void AddError(Error error, List <Error> errorList)
 {
     if (ThrowExceptionIfNotValid)
     {
         throw SDMXValidationException.Create(new List <Error> {
             error
         }, error.Message);
     }
     else
     {
         errorList.Add(error);
     }
 }
コード例 #2
0
ファイル: DataWriter.cs プロジェクト: tomplusit/sdmxdotnet
        /// <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);
        }