/// <summary>
        /// Resolves a UrlName from the specified value using the specified <paramref name="culture"/>
        /// </summary>
        /// <param name="value">The value.</param>
        /// <param name="culture">The culture.</param>
        /// <returns></returns>
        public IUrlNameBuilder Resolve(string value, CultureInfo culture)
        {
            var combinedMap =
                new CompositeCharacterRomanizer(_romanizationProvider.GetRomanizersFromCulture(culture));

            var normalizer = new UrlNameRomanizer(_options, combinedMap);

            var info = new UrlNameInfo(normalizer.Normalize(value));

            return new DefaultUrlNameBuilder(info, _incrementer);
        }
 public void Increment(UrlNameInfo builder)
 {
     builder.Current = $"{CreateHash(builder.Initial, builder.Iteration)}-{builder.Initial}";
 }
Beispiel #3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="DefaultUrlNameBuilder"/> class.
 /// </summary>
 /// <param name="urlNameInfo">The URL-name information.</param>
 /// <param name="incrementer">The incrementer to use.</param>
 public DefaultUrlNameBuilder(UrlNameInfo urlNameInfo, IUrlNameIncrementer incrementer)
 {
     _urlNameInfo = urlNameInfo;
     _incrementer = incrementer;
 }