From 66b31582c0be1d1532bc5c289fb36f902e1b0faa Mon Sep 17 00:00:00 2001 From: Simon Gockner Date: Sat, 14 Dec 2019 21:23:59 +0100 Subject: [PATCH] #33: add iMultipleRegistration to registrationFactory, rename RegisterMultiton --- .../Registrations/RegistrationFactory.cs | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/LightweightIocContainer/Registrations/RegistrationFactory.cs b/LightweightIocContainer/Registrations/RegistrationFactory.cs index d780413..0c4bf61 100644 --- a/LightweightIocContainer/Registrations/RegistrationFactory.cs +++ b/LightweightIocContainer/Registrations/RegistrationFactory.cs @@ -33,6 +33,19 @@ namespace LightweightIocContainer.Registrations return new DefaultRegistration(typeof(TInterface), typeof(TImplementation), lifestyle); } + /// + /// Register multiple interfaces for a that implements them and create a + /// + /// The base interface to register + /// A second interface to register + /// The that implements both interfaces + /// The for this + /// The created + public IMultipleRegistration Register(Lifestyle lifestyle) where TImplementation : TInterface1, TInterface2 + { + return new MultipleRegistration(typeof(TInterface1), typeof(TInterface2), typeof(TImplementation), lifestyle); + } + /// /// Register a without an interface and create a /// @@ -51,7 +64,7 @@ namespace LightweightIocContainer.Registrations /// The Type that implements the interface /// The Type of the multiton scope /// A new created with the given parameters - public IMultitonRegistration Register() where TImplementation : TInterface + public IMultitonRegistration RegisterMultiton() where TImplementation : TInterface { return new MultitonRegistration(typeof(TInterface), typeof(TImplementation), typeof(TScope)); }