Ejemplo n.º 1
0
        private static string GetErrorMessage(DataTypeError error)
        {
            if (error == null)
            {
                return(null);
            }

            return(string.Format(CultureInfo.InvariantCulture, "Data model type checking failed for type '{0}'. {1}", error.Type.ToCSharpString(), error.Message));
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Creates a new data type violation exception with the specified diagnostic error object.
 /// </summary>
 /// <param name="error">Diagnostic error object.</param>
 public DataTypeException(DataTypeError error)
     : base(GetErrorMessage(error))
 {
     Error = error ?? throw new ArgumentNullException(nameof(error));
 }