public override string GetString(string originalKey, string[] normalizedKey, CultureInfo culture) { // we need to call handler directly here // if we would dispatch query and ask registered handler to execute // we would end up in stackoverflow as in EPiServer context // the same database localization provider is registered as the query handler. var q = new GetTranslation.Handler(); return(q.Execute(new GetTranslation.Query(originalKey, culture))); }
public override string GetString(string originalKey, string[] normalizedKey, CultureInfo culture) { // we need to call handler directly here // if we would dispatch query and ask registered handler to execute // we would end up in stack-overflow as in EPiServer context // the same database localization provider is registered as the query handler // TODO: this seems to be odd, no point for decorators. needs to be reviewed IQueryHandler<GetTranslation.Query, string> originalHandler = new GetTranslation.Handler(); if(ConfigurationContext.Current.DiagnosticsEnabled) originalHandler = new EPiServerGetTranslation.HandlerWithLogging(new GetTranslation.Handler()); return originalHandler.Execute(new GetTranslation.Query(originalKey, culture, false)); }
public override string GetString(string originalKey, string[] normalizedKey, CultureInfo culture) { // we need to call handler directly here // if we would dispatch query and ask registered handler to execute // we would end up in stack-overflow as in EPiServer context // the same database localization provider is registered as the query handler // TODO: this seems to be odd, no point for decorators. needs to be reviewed IQueryHandler <GetTranslation.Query, string> originalHandler = new GetTranslation.Handler(); if (ConfigurationContext.Current.DiagnosticsEnabled) { originalHandler = new EPiServerGetTranslation.HandlerWithLogging(new GetTranslation.Handler()); } return(originalHandler.Execute(new GetTranslation.Query(originalKey, culture, false))); }
public HandlerWithLogging(GetTranslation.Handler inner) { _inner = inner; _logger = LogManager.GetLogger(typeof(Handler)); }