Path: redb/redb.Core/Exceptions/RedbSynchronousLazyLoadException.cs
Snapshot: redb, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages.
License: Apache-2.0. Repository: https://github.com/redbase-app/redb
Page: https://redbase.app/src/dev-2026-12-06/redb/redb.Core/Exceptions/RedbSynchronousLazyLoadException.cs
----
using System;
namespace redb.Core.Exceptions;
///
/// Thrown by the Props getter of an unloaded reference when
/// RedbServiceConfiguration.LazyReferenceAccess is Throw: the host has said that a
/// hidden, blocking database round trip on property access is a defect (Blazor WebAssembly cannot
/// block at all; a UI thread should not), so the getter names the explicit way instead of loading.
///
public class RedbSynchronousLazyLoadException : InvalidOperationException
{
/// Id of the object whose Props were asked for.
public long ObjectId { get; }
/// Scheme of that object.
public long SchemeId { get; }
public RedbSynchronousLazyLoadException(long objectId, long schemeId)
: base($"Object {objectId} (scheme {schemeId}) is an unloaded reference and LazyReferenceAccess is Throw: " +
"synchronous loading on Props access is disabled for this host. Load it explicitly - " +
"await obj.LoadPropsAsync(), or redb.LoadReferencesAsync(parent, p => p.Reference) for a batch - " +
"or load the parent with a larger depth.")
{
ObjectId = objectId;
SchemeId = schemeId;
}
}