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
messagestringThe exception message.
TrellisPersistenceMappingException(string, Exception)
Initializes a new instance of the TrellisPersistenceMappingException class.
public TrellisPersistenceMappingException(string message, Exception innerException)
Parameters
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
valueObjectTypeTypeThe Trellis value object type that could not be materialized.
persistedValueobjectThe persisted value that failed materialization.
factoryMethodstringThe factory method used during materialization.
detailstringThe validation or mapping detail describing the failure.
innerExceptionExceptionThe underlying exception, if one was thrown.
Properties
Detail
Gets the validation or mapping detail describing the failure.
public string Detail { get; }
Property Value
FactoryMethod
Gets the factory method used during materialization.
public string FactoryMethod { get; }
Property Value
PersistedValue
Gets the persisted value that failed materialization.
public object? PersistedValue { get; }
Property Value
ValueObjectType
Gets the Trellis value object type that could not be materialized.
public Type ValueObjectType { get; }