- add OpenGenericRegistration

pull/43/head
Simon G 5 years ago
parent 2225c28e00
commit e816546eb2
  1. 13
      LightweightIocContainer/Interfaces/Registrations/IOpenGenericRegistration.cs
  2. 26
      LightweightIocContainer/Registrations/OpenGenericRegistration.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; }
}
}

@ -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; }
}
}
Loading…
Cancel
Save