public CryoContainer RegisterProvider <T>(IObjectProvider provider, string name = null) { var key = new ContainerKey(typeof(T), name); _providers[key] = provider; return(this); }
private IObjectProvider ResolveProvider(Type type, string name, out ContainerKey key) { key = new ContainerKey(type, name); IObjectProvider provider = null; _providers.TryGetValue(key, out provider); return(provider); }
public void Push(ContainerKey key, LifeTime lifetime) { _stack.Add(new Entry { Key = key, LifeTime = lifetime }); CheckLifeTime(); }
protected bool Equals(ContainerKey other) { return((Type == other.Type) && string.Equals(Name, other.Name)); }