diff --git a/LightweightIocContainer/Interfaces/Registrations/IOpenGenericRegistration.cs b/LightweightIocContainer/Interfaces/Registrations/IOpenGenericRegistration.cs new file mode 100644 index 0000000..4081365 --- /dev/null +++ b/LightweightIocContainer/Interfaces/Registrations/IOpenGenericRegistration.cs @@ -0,0 +1,13 @@ +// Author: Simon Gockner +// Created: 2020-09-18 +// Copyright(c) 2020 SimonG. All Rights Reserved. + +using System; + +namespace LightweightIocContainer.Interfaces.Registrations +{ + public interface IOpenGenericRegistration : IRegistration, ILifestyleProvider + { + Type ImplementationType { get; } + } +} \ No newline at end of file diff --git a/LightweightIocContainer/Registrations/OpenGenericRegistration.cs b/LightweightIocContainer/Registrations/OpenGenericRegistration.cs new file mode 100644 index 0000000..03a51f1 --- /dev/null +++ b/LightweightIocContainer/Registrations/OpenGenericRegistration.cs @@ -0,0 +1,26 @@ +// Author: Simon Gockner +// Created: 2020-09-18 +// Copyright(c) 2020 SimonG. All Rights Reserved. + +using System; +using LightweightIocContainer.Interfaces.Registrations; + +namespace LightweightIocContainer.Registrations +{ + public class OpenGenericRegistration : IOpenGenericRegistration + { + public OpenGenericRegistration(Type interfaceType, Type implementationType, Lifestyle lifestyle) + { + InterfaceType = interfaceType; + ImplementationType = implementationType; + Lifestyle = lifestyle; + + Name = $"{InterfaceType.Name}, {ImplementationType.Name}, Lifestyle: {Lifestyle.ToString()}"; + } + + public string Name { get; } + public Type InterfaceType { get; } + public Type ImplementationType { get; } + public Lifestyle Lifestyle { get; } + } +} \ No newline at end of file