public object Create(ServiceInstantiationGraph instantiationGraph, AbstractLifeTime lifetime) { if (_instance == null) _instance = _factory.Create(instantiationGraph, lifetime); return _instance; }
/// <summary> /// Fetches an instance of <paramref name="contractType"/> in the current graph, or asks the container for a new instance /// </summary> /// <param name="contractType">Type of service required</param> /// <param name="lifetime"></param> /// <returns>Instance of <paramref name="contractType"/></returns> public object Get(Type contractType, AbstractLifeTime lifetime) { var key = new ServiceKey(contractType); var instance = _container.ResolveAndBuildService(contractType, lifetime, this); Instances[key] = instance; return instance; }
public object Create(ServiceInstantiationGraph instantiationGraph, AbstractLifeTime lifetime) { return _staticInstance; }