Table of Contents

Class ValueMappingException

Namespace
Open.Database.Extensions
Assembly
Open.Database.Extensions.Core.dll

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.

[SuppressMessage("Roslynator", "RCS1194:Implement exception constructors")]
public sealed class ValueMappingException : DataException, ISerializable
Inheritance
ValueMappingException
Implements
Inherited Members

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.

Constructors

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.

Properties

ColumnName

The name of the column being read; empty when the failure names no column (see the remarks).

PropertyName

The name of the property being set; empty when the failure names no member (see the remarks).

TargetType

The .NET type the value was being read as.