NotInTheContextOfARepositoryException Class
HAKOM.Persistence.Http.Net.Api.References.Exceptions
Section titled “HAKOM.Persistence.Http.Net.Api.References.Exceptions”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.HakomExceptionInheritance System.Object 🡒 System.Exception 🡒 HakomException 🡒 NotInTheContextOfARepositoryException
Remarks
Section titled “Remarks”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.
Properties
Section titled “Properties”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; }Property Value
Section titled “Property Value”NotInTheContextOfARepositoryException.ReferenceTypeName Property
Section titled “NotInTheContextOfARepositoryException.ReferenceTypeName Property”The name of the type of reference for which deserialization failed.
public string ReferenceTypeName { get; }