Table of Contents

Class TrellisPersistenceMappingException

Namespace
Trellis.EntityFrameworkCore
Assembly
Trellis.EntityFrameworkCore.dll

Represents a failure to materialize a Trellis value object from persisted data.

public sealed class TrellisPersistenceMappingException : InvalidOperationException, ISerializable
Inheritance
TrellisPersistenceMappingException
Implements
Inherited Members
Extension Methods

Remarks

This exception is thrown when EF Core reads a database value and the corresponding Trellis value object cannot be reconstructed through its validation factory.

Constructors

TrellisPersistenceMappingException()

Initializes a new instance of the TrellisPersistenceMappingException class.

public TrellisPersistenceMappingException()

TrellisPersistenceMappingException(string)

Initializes a new instance of the TrellisPersistenceMappingException class.

public TrellisPersistenceMappingException(string message)

Parameters

message string

The exception message.

TrellisPersistenceMappingException(string, Exception)

Initializes a new instance of the TrellisPersistenceMappingException class.

public TrellisPersistenceMappingException(string message, Exception innerException)

Parameters

message string

The exception message.

innerException Exception

The inner exception.

TrellisPersistenceMappingException(Type, object?, string, string, Exception?)

Initializes a new instance of the TrellisPersistenceMappingException class.

public TrellisPersistenceMappingException(Type valueObjectType, object? persistedValue, string factoryMethod, string detail, Exception? innerException = null)

Parameters

valueObjectType Type

The Trellis value object type that could not be materialized.

persistedValue object

The persisted value that failed materialization.

factoryMethod string

The factory method used during materialization.

detail string

The validation or mapping detail describing the failure.

innerException Exception

The underlying exception, if one was thrown.

Properties

Detail

Gets the validation or mapping detail describing the failure.

public string Detail { get; }

Property Value

string

FactoryMethod

Gets the factory method used during materialization.

public string FactoryMethod { get; }

Property Value

string

PersistedValue

Gets the persisted value that failed materialization.

public object? PersistedValue { get; }

Property Value

object

ValueObjectType

Gets the Trellis value object type that could not be materialized.

public Type ValueObjectType { get; }

Property Value

Type