public void OnBeforeActionMethod(
            IActionContext actionContext,
            IDictionary <string, object> arguments)
        {
            var startDateTime    = DateTime.UtcNow;
            var actionDescriptor = ConvertActionDescriptor(actionContext.ActionDescriptor);

            var message = new BeforeActionInvokedMessage
            {
                ActionId               = actionDescriptor.Id,
                ActionDisplayName      = actionDescriptor.DisplayName,
                ActionName             = actionDescriptor.ActionName,
                ActionControllerName   = actionDescriptor.ControllerName,
                ActionTargetClass      = actionDescriptor.ControllerTypeInfo.Name,
                ActionTargetMethod     = actionDescriptor.MethodInfo.Name,
                ActionInvokedStartTime = startDateTime,
                Binding = arguments?.Select(x => new BindingData {
                    Type = TypeNameHelper.GetTypeDisplayName(x.Value, false), TypeFullName = TypeNameHelper.GetTypeDisplayName(x.Value), Name = x.Key, Value = SanitizeUserObjectsHelper.GetSafeObject(x.Value)
                }).ToList()
            };

            _broker.BeginLogicalOperation(message, startDateTime);
            _broker.SendMessage(message);
        }
        public void OnBeforeViewComponent(IViewComponentContext viewComponentContext)
        {
            var startDateTime = DateTime.UtcNow;

            var message = new BeforeViewComponentMessage
            {
                ComponentId          = viewComponentContext.ViewComponentDescriptor.Id,
                ComponentDisplayName = viewComponentContext.ViewComponentDescriptor.FullName,
                ComponentName        = viewComponentContext.ViewComponentDescriptor.ShortName,
                ComponentStartTime   = startDateTime,
                Arguments            = viewComponentContext.Arguments?.Select(x => new ArgumentData {
                    Type = TypeNameHelper.GetTypeDisplayName(x, false), TypeFullName = TypeNameHelper.GetTypeDisplayName(x), Name = null, Value = SanitizeUserObjectsHelper.GetSafeObject(x)
                }).ToList()
            };

            _broker.BeginLogicalOperation(message, startDateTime);
            _broker.SendMessage(message);
        }