public FSharpAsync <ConnectionAction> OnConnectionBeforeHandler(
            IDiResolveReleaseOnlyContainer di, string url, object serviceInstanceOrNull,
            MethodInfo methodOrNull, object[] parms, ResourceType res)
        {
            var ci   = di.Resolve <ClientConnectionInfo>();
            var guid = Guid.NewGuid().ToString();

            LogAsReply($"OnConnectionBeforeHandler() ip={ci.ClientIpAddress} guid={guid} url={url} resourceType={res.ToString()} serviceImpl={serviceInstanceOrNull} method={methodOrNull} parms={parms}");

            var ctx = new FilterInvocation {
                Url     = url,
                ResType = res,
                InvType = FilterInvocationType.BeforeConnection,
                FullInterfaceNameOrNull = serviceInstanceOrNull == null ?
                                          null
                    :
                                          FindServiceInterfaceType(serviceInstanceOrNull).FullName,
                MethodNameOrNull = methodOrNull?.Name,
                Guid             = guid
            };

            SendFilterInvocation(ctx);

            return(FSharpAsyncUtil.FromResult(ConnectionAction.CreateNonFiltered(ctx)));
        }
Example #2
0
        public FSharpAsync <ConnectionAction> OnConnectionBeforeHandler(
            IDiResolveReleaseOnlyContainer di, string url, object serviceInstance,
            MethodInfo method, object[] prms, ResourceType res)
        {
            var ci   = di.Resolve <ClientConnectionInfo>();
            var guid = Guid.NewGuid().ToString();

            Logger.Debug(typeof(LifeTimeFilter), $"OnConnectionBeforeHandler() ip={ci.ClientIpAddress} guid={guid} url={url} resourceType={res.ToString()} serviceImpl={serviceInstance} method={method} prms={prms}");
            return(FSharpAsyncUtil.FromResult(ConnectionAction.CreateNonFiltered(guid)));
        }