Class ServiceAlreadyRegisteredException
The exception that is thrown on duplicate service registration.
Inheritance
System.Object
ServiceAlreadyRegisteredException
Namespace: Solti.Utils.DI.Interfaces
Assembly: Solti.Utils.DI.Interfaces.dll
Syntax
public sealed class ServiceAlreadyRegisteredException : Exception
Remarks
To bind multiple services to the same interface, consider naming them:
ScopeFactory.Create
(
svcs => svcs.Service<IMyService, MyService>("serviceName", Lifetime.Singleton),
...
)
Constructors
ServiceAlreadyRegisteredException(String, AbstractServiceEntry)
Creates a new ServiceAlreadyRegisteredException instance.
Declaration
public ServiceAlreadyRegisteredException(string message, AbstractServiceEntry entry)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | message | |
| AbstractServiceEntry | entry |
Properties
Entry
The service descriptor whose registration was failed.
Declaration
public AbstractServiceEntry Entry { get; }
Property Value
| Type | Description |
|---|---|
| AbstractServiceEntry |