public Dictionary <string, object> BuildRouteValues(TokenHandlerContext context, IEnumerable <string> excludedParameterNames) { return(context .Parameters .Keys .Except(excludedParameterNames, StringComparer.OrdinalIgnoreCase) .ToDictionary( key => key, key => (object)context.Parameters[key])); }
public string GetTokenValue(Customer customer, string token, IDictionary <string, string> parameters) { if (customer == null) { throw new ArgumentNullException("customer"); } var effectiveParamaters = parameters == null ? new Dictionary <string, string>() : new Dictionary <string, string>(parameters, StringComparer.OrdinalIgnoreCase); var tokenHandlerContext = new TokenHandlerContext(customer, token, effectiveParamaters); return(TokenHandlers .Select(handler => handler.RenderToken(tokenHandlerContext)) .Where(result => result != null) .FirstOrDefault()); }
public string GetSeNameParameterValue(TokenHandlerContext context, string seNameParam) { return(context.Parameters.ContainsKey(seNameParam) ? context.Parameters[seNameParam] ?? string.Empty : string.Empty); }
public string GetEntityTypeParameterValue(TokenHandlerContext context, string entityNameParam) { return(context.Parameters.ContainsKey(entityNameParam) ? context.Parameters[entityNameParam] ?? string.Empty : string.Empty); }
public int GetEntityIdParameterValue(TokenHandlerContext context, string entityIdParam) { return(context.Parameters.ContainsKey(entityIdParam) ? Localization.ParseUSInt(context.Parameters[entityIdParam]) : 0); }