Class ServiceNotFoundException
The exception that is thrown when a service could not be found.
Inheritance
System.Object
ServiceNotFoundException
Namespace: Solti.Utils.DI.Interfaces
Assembly: Solti.Utils.DI.Interfaces.dll
Syntax
public sealed class ServiceNotFoundException : Exception
Remarks
If the requested service is optional, consider using the TryGet(Type, Object) method in order to avoid this error.
Constructors
ServiceNotFoundException(String, AbstractServiceEntry, IServiceId)
Creates a new ServiceNotFoundException instance.
Declaration
public ServiceNotFoundException(string message, AbstractServiceEntry requestor, IServiceId requested)
Parameters
Type | Name | Description |
---|---|---|
System.String | message | |
AbstractServiceEntry | requestor | |
IServiceId | requested |
Properties
Requested
The requested service.
Declaration
public IServiceId Requested { get; }
Property Value
Type | Description |
---|---|
IServiceId |
Requestor
The dependant service which requested the missing service.
Declaration
public AbstractServiceEntry Requestor { get; }
Property Value
Type | Description |
---|---|
AbstractServiceEntry |
Remarks
This property may be null if the request was initiated from user code:
scope.Get<IMissingService>()