You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
17 lines
446 B
17 lines
446 B
using Microsoft.AspNetCore.Routing;
|
|
using System.Text.RegularExpressions;
|
|
|
|
namespace Microsoft.eShopWeb.Web
|
|
{
|
|
|
|
public class SlugifyParameterTransformer : IOutboundParameterTransformer
|
|
{
|
|
public string TransformOutbound(object value)
|
|
{
|
|
if (value == null) { return null; }
|
|
|
|
// Slugify value
|
|
return Regex.Replace(value.ToString(), "([a-z])([A-Z])", "$1-$2").ToLower();
|
|
}
|
|
}
|
|
}
|
|
|