Class RedbSchemeMismatchException

Assembly: redb.Core.dll

Thrown by LoadAsync<TProps> when the loaded object belongs to a different scheme than
TProps maps to, and RedbServiceConfiguration.ThrowOnSchemeMismatch is set.
By default the mismatch is not thrown — LoadAsync returns null instead, so a
soft-deleted object (scheme -10) reads as null. Set the flag to surface a genuine type
mistake loudly.

The check exists because loading an object under the wrong Props type deserializes garbage into the
fields and — with EnablePropsCache — caches it under that type, so a following
GetWithoutHashValidation would keep returning the garbage. Whether it throws or returns null,
the garbage never reaches the cache.


The untyped LoadAsync(objectId) (returning IRedbObject without Props) is never affected.

public class RedbSchemeMismatchException : Exception, ISerializable

Inheritance

Object→Exception→RedbSchemeMismatchException

Implements

Properties

ActualSchemeId

Scheme id the loaded object actually has.

public long ActualSchemeId { get; }

ExpectedSchemeId

Scheme id that maps to.

public long ExpectedSchemeId { get; }

ObjectId

Id of the object that was loaded.

public long ObjectId { get; }

RequestedType

The Props type the caller asked for.

public Type RequestedType { get; }

Constructors