Beispiel #1
0
        /// <summary>
        /// Create instantiation expression
        /// </summary>
        /// <param name="scope">scope the configuration is associated with</param>
        /// <param name="request">expression request</param>
        /// <param name="activationConfiguration">configuration</param>
        /// <returns>expression result</returns>
        public override IActivationExpressionResult CreateExpression(IInjectionScope scope, IActivationExpressionRequest request,
                                                                     TypeActivationConfiguration activationConfiguration)
        {
            var expression = base.CreateExpression(scope, request, activationConfiguration);

            var timedCreateExpression = CreateTimedCreateExpression(scope, request, activationConfiguration, expression);

            var createDelegate = request.Services.Compiler.CompileDelegate(scope, timedCreateExpression);

            return(ExpressionUtilities.CreateExpressionForDelegate(createDelegate, false, scope, request));
        }
 /// <summary>
 /// Create expression that calls a delegate
 /// </summary>
 /// <param name="scope">scope for the request</param>
 /// <param name="request">activation request</param>
 /// <returns></returns>
 protected virtual IActivationExpressionResult CreateExpression(IInjectionScope scope,
                                                                IActivationExpressionRequest request)
 {
     return(ExpressionUtilities.CreateExpressionForDelegate(DelegateInstance, ShouldTrackDisposable(scope), scope, request, this));
 }
 /// <summary>
 /// Get decorator expression
 /// </summary>
 /// <param name="scope"></param>
 /// <param name="request"></param>
 /// <returns></returns>
 protected virtual IActivationExpressionResult InternalGetDecoratorActivationExpression(IInjectionScope scope, IActivationExpressionRequest request)
 {
     return(ExpressionUtilities.CreateExpressionForDelegate(_delegate, false, InjectionScope, request, this));
 }