public IViewComponentResult Invoke() { return(View( new Model { EnableProductImprovement = _applicationConfigurationService.IsProductImprovementEnabled(), MeasurementId = _appSettings.GoogleAnalyticsMeasurementId, UserId = _adminAppUserContext?.User?.Id })); }
public ActionResult Error() { var exceptionHandlerFeature = HttpContext.Features.Get <IExceptionHandlerPathFeature>(); var exception = exceptionHandlerFeature?.Error ?? new Exception(); _logger.Error(exception); var errorModel = new ErrorModel(exception, _applicationConfigurationService.IsProductImprovementEnabled() && HttpContext.User.Identity.IsAuthenticated); return(HttpContext.Request.IsAjaxRequest() ? (ActionResult)PartialView("_ErrorFeedback", errorModel) : View(errorModel)); }
public async Task OnActionExecutionAsync(ActionExecutingContext filterContext, ActionExecutionDelegate next) { if (_applicationConfigurationService.IsProductImprovementEnabled() && !string.IsNullOrEmpty(_appSettings.GoogleAnalyticsMeasurementId)) { try { if (_type == TelemetryType.Event) { await _telemetry.Event(_action); } else { await _telemetry.View(_action); } } catch (Exception e) { _logger.Error("Google Analytics Add Telemetry Filter failed", e); } } await next(); }