#33: add typedRegistrationBase

pull/37/head
Simon Gockner 6 years ago
parent 3f83b544d8
commit d682ebc233
  1. 19
      LightweightIocContainer/Interfaces/Registrations/ITypedRegistrationBase.cs
  2. 32
      LightweightIocContainer/Registrations/TypedRegistrationBase.cs

@ -0,0 +1,19 @@
// Author: Simon Gockner
// Created: 2019-12-08
// Copyright(c) 2019 SimonG. All Rights Reserved.
using System;
namespace LightweightIocContainer.Interfaces.Registrations
{
/// <summary>
/// A <see cref="IRegistrationBase{TInterface}"/> that implements a <see cref="Type"/>
/// </summary>
public interface ITypedRegistrationBase<TInterface> : IRegistrationBase<TInterface>
{
/// <summary>
/// The <see cref="Type"/> that implements the <see cref="IRegistration.InterfaceType"/> that is registered with this <see cref="IRegistrationBase{TInterface}"/>
/// </summary>
Type ImplementationType { get; }
}
}

@ -0,0 +1,32 @@
// Author: Simon Gockner
// Created: 2019-12-14
// Copyright(c) 2019 SimonG. All Rights Reserved.
using System;
using LightweightIocContainer.Interfaces.Registrations;
namespace LightweightIocContainer.Registrations
{
/// <summary>
/// A <see cref="IRegistrationBase{TInterface}"/> that implements a <see cref="Type"/>
/// </summary>
public abstract class TypedRegistrationBase<TInterface> : RegistrationBase<TInterface>, ITypedRegistrationBase<TInterface>
{
/// <summary>
/// A <see cref="IRegistrationBase{TInterface}"/> that implements a <see cref="Type"/>
/// </summary>
/// <param name="interfaceType">The <see cref="Type"/> of the interface</param>
/// <param name="implementationType">The <see cref="Type"/> of the implementation type</param>
/// <param name="lifestyle">The <see cref="Lifestyle"/> of this <see cref="IRegistrationBase{TInterface}"/></param>
protected TypedRegistrationBase(Type interfaceType, Type implementationType, Lifestyle lifestyle)
: base(interfaceType, lifestyle)
{
ImplementationType = implementationType;
}
/// <summary>
/// The <see cref="Type"/> that implements the <see cref="IRegistration.InterfaceType"/> that is registered with this <see cref="IRegistrationBase{TInterface}"/>
/// </summary>
public Type ImplementationType { get; }
}
}
Loading…
Cancel
Save