Table of Contents

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

message string

The error message.

propertyName string

The name of the property being set.

columnName string

The name of the column being read.

targetType Type

The .NET type the value was being read as.

innerException Exception

The 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.