public override object GetObject(Type requestedType, TinyIoCContainer container, NamedParameterOverloads parameters, ResolveOptions options) { try { return(container.ConstructType(requestedType, registerImplementation, Constructor, parameters, options)); } catch (TinyIoCResolutionException ex) { throw new TinyIoCResolutionException(registerType, ex); } }
public override object GetObject(Type requestedType, TinyIoCContainer container, NamedParameterOverloads parameters, ResolveOptions options) { if (parameters.Count != 0) { throw new ArgumentException("Cannot specify parameters for singleton types"); } lock (SingletonLock) if (_Current == null) { _Current = container.ConstructType(requestedType, registerImplementation, Constructor, options); } return(_Current); }
public override object GetObject(Type requestedType, TinyIoCContainer container, NamedParameterOverloads parameters, ResolveOptions options) { object current; lock (SingletonLock) { current = _LifetimeProvider.GetObject(); if (current == null) { current = container.ConstructType(requestedType, registerImplementation, Constructor, options); _LifetimeProvider.SetObject(current); } } return(current); }