TenantNotFoundException class
Namespace: Tenantry · Package: Tenantry.Core · API reference
Thrown when a tenant is looked up by its id and the tenant store has no tenant with that id, for example by ITenantScopeFactory<TKey>.RunInScopeAsync.
It derives from TenantNotResolvedException, so code that handles that exception handles this one too. Catch it first to treat a message or job for a tenant that no longer exists differently from code that runs without a tenant.
public sealed class TenantNotFoundException : TenantNotResolvedException, ISerializableInherits Exception → SystemException → InvalidOperationException → TenantNotResolvedException.
Implements ISerializable.
Constructors
TenantNotFoundException(object)
Initialises a new instance for the tenant id that was not found.
public TenantNotFoundException(object tenantId)Parameters:
tenantIdobject: The id that was looked up.
TenantNotFoundException(object, string)
Initialises a new instance for the tenant id that was not found, with a custom message.
public TenantNotFoundException(object tenantId, string message)Parameters:
tenantIdobject: The id that was looked up.messagestring: The message that describes the error.
Properties
TenantId
The id that was looked up, of the application's tenant key type.
public object TenantId { get; }Value: object
TenantEntity<TKey> class
Optional base class for tenant-owned entities, implementing ITenantEntity<TKey>tenantry-itenantentity.md.
TenantNotResolvedException class
Thrown when an operation needs a current tenant and none is current, or when the tenant it names does not exist TenantNotFoundExceptiontenantry-tenantnotfoundexception.md.