Constructor ValueMappingException
- Namespace
- Open.Database.Extensions
- Assembly
- Open.Database.Extensions.Core.dll
ValueMappingException(string, string, string, Type, Exception?)
The exception that is thrown when a column value cannot be mapped to the requested .NET type: a value that does not convert, an overflow, and so on.
public ValueMappingException(string message, string propertyName, string columnName, Type targetType, Exception? innerException = null)
Parameters
messagestringThe error message.
propertyNamestringThe name of the property being set.
columnNamestringThe name of the column being read.
targetTypeTypeThe .NET type the value was being read as.
innerExceptionExceptionThe provider's or the conversion's error, if any.
Remarks
The provider's or the conversion's error is the InnerException.
A row that fails names the model and the row in the message. A NULL into a non-nullable member names the model and the row only; to have it name the member and the column, declare NullPolicyAttribute with Throw, and to replace a NULL instead, declare NullValueAttribute. A Throw policy and a required member no column feeds set PropertyName and ColumnName.
This is a DataException.