public IEnumerable<INeed> GetNeeds(IGenerationContext context) { if (_myNeed.Key==null) { var buildContext = context.BuildContext; var genCtx = new GenerationContext(context.Container, _nestedRegistration, buildContext, _type.GetMethod("Invoke").GetParameters()); _myNeed.Key = genCtx.GenerateFunc(_type); } yield return _myNeed; }
public IEnumerable <INeed> GetNeeds(IGenerationContext context) { if (_myNeed.Key == null) { var buildContext = context.BuildContext; var genCtx = new GenerationContext(context.Container, _nestedRegistration, buildContext, _type.GetMethod("Invoke").GetParameters()); _myNeed.Key = genCtx.GenerateFunc(_type); } yield return(_myNeed); }
internal Func<object> BuildFromRegistration(ICRegILGen registration, IBuildContext buildContext) { var regOpt = registration as ICRegFuncOptimized; if (regOpt != null) { var result = (Func<object>)regOpt.BuildFuncOfT(this, typeof(Func<object>)); if (result != null) { return result; } } var context = new GenerationContext(this, registration, buildContext); return (Func<object>)context.GenerateFunc(typeof(Func<object>)); }