mirror of
https://github.com/farcasclaudiu/myfriendsaround.git
synced 2026-06-28 21:01:39 +03:00
25 lines
697 B
C#
25 lines
697 B
C#
using System;
|
|
|
|
namespace MicroIoc
|
|
{
|
|
public class ContainerConfiguration : IConfiguration
|
|
{
|
|
private readonly IMicroIocContainer _container;
|
|
|
|
public ContainerConfiguration(IMicroIocContainer container)
|
|
{
|
|
if (container == null)
|
|
throw new ArgumentNullException("container");
|
|
|
|
_container = container;
|
|
}
|
|
|
|
public IConfiguration Configure<T>(InjectedMemberBase injection)
|
|
{
|
|
var fullName = injection.DeriveFullName<T>();
|
|
_container.RegisterInstance(injection.MemberValue.GetType(), injection.MemberValue, fullName);
|
|
return this;
|
|
}
|
|
}
|
|
}
|