Skip to content
Documentation

NotInTheContextOfARepositoryException Class

This error occurs when no storage information is passed while deserializing a reference and the IDefaultStorageInformationProvider<TReference> registered for that type requires information about the current repository in order to determine the default storage information.

public sealed class NotInTheContextOfARepositoryException : HAKOM.ErrorHandling.Core.Net.Api.HakomException

Inheritance System.Object 🡒 System.Exception 🡒 HakomException 🡒 NotInTheContextOfARepositoryException

To avoid this issue, make sure all references of this type include a storage information property for deserialization or make sure this deserialization operation only occurs within an HTTP request that contains information about what repository the references should be resolved from by default.

Information about the current requests repository can be set by adding either a string with the key RepositoryName that contains the name of the repository to use, or an instance that implements IRepository to the Microsoft.AspNetCore.Http.HttpContext.Items Dictionary.

This exception is identified by error code HK12048.

NotInTheContextOfARepositoryException.EquivalentHttpStatusCode Property

Section titled “NotInTheContextOfARepositoryException.EquivalentHttpStatusCode Property”

When unhandled within an HTTP request, this exception produces HTTP 400 (Bad Request).

protected override System.Net.HttpStatusCode EquivalentHttpStatusCode { protected get; }

System.Net.HttpStatusCode

NotInTheContextOfARepositoryException.ReferenceTypeName Property

Section titled “NotInTheContextOfARepositoryException.ReferenceTypeName Property”

The name of the type of reference for which deserialization failed.

public string ReferenceTypeName { get; }

System.String

© 2026 Volue.Version v0.6.38017 November 2026