Exemplo n.º 1
0
 public virtual void SetIdentifier(object identifier)
 {
     if (_hashCode.HasValue)
     {
         Throw.BadAct("Identifier can only be set once.");
     }
     _hashCode = HashCodeFor(identifier);
 }
Exemplo n.º 2
0
        public override ILifetimeScopeShim BeginLifetimeScope()
        {
            if (_scopeShim != null)
            {
                Throw.BadAct("A lifetime scope was already started.");
            }

            return(_scopeShim = new LifetimeScopeShim(this));
        }
Exemplo n.º 3
0
        public T Resolve <T, TArg>(TArg constructorArg)
        {
            if (_scopeShim == null)
            {
                Throw.BadAct("Call Resolv.r.BeginLifetimeScope() before resolving anything.");
            }

            return(_scopeShim.Resolve <T, TArg>(constructorArg));
        }
Exemplo n.º 4
0
        public T Resolve <T>()
        {
            if (_scopeShim == null)
            {
                Throw.BadAct("Call Resolv.r.BeginLifetimeScope() before resolving anything.");
            }

            return(_scopeShim.Resolve <T>());
        }