Contract for types allow registering a set of services.
Namespace: SimpleInjector.Packaging
Assembly: SimpleInjector.Packaging (in SimpleInjector.Packaging.dll) Version: 4.10.2
Syntax
The IPackage type exposes the following members.
Methods
Name | Description | |
---|---|---|
RegisterServices | Registers the set of services in the specified container. |
Examples
C#
public class BusinessLayerPackage : IPackage { public void RegisterServices(Container container) { container.Register<IUserRepository, DatabaseUserRepository>(); container.Register<ICustomerRepository, DatabaseCustomerRepository>(); } }
C#
container.RegisterPackages();
See Also