public virtual void Process(ModelPropertyContext context) { var url = (string)context.PropertyValue; var friendlyUrl = _urlRewriter.GetFriendlyUrl(url, context.ExecutionContext.RequestContext, RouteTable.Routes); context.PropertyValue = friendlyUrl; }
public virtual void Process(ModelPropertyContext context) { var url = ((IHtmlString)context.PropertyValue).IfNotNull(x => x.ToHtmlString()); var friendlyUrl = _urlRewriter.GetFriendlyUrl(url, context.ExecutionContext.RequestContext, RouteTable.Routes); context.PropertyValue = HtmlStringActivator.CreateInstance(context.Property.PropertyType, friendlyUrl); }
public virtual void Process(ModelPropertyContext context) { var links = (IEnumerable <Link>)context.PropertyValue; foreach (var link in links) { link.Url = _urlRewriter.GetFriendlyUrl(link.Url, context.ExecutionContext.RequestContext, RouteTable.Routes); } }
public virtual void Process(ModelPropertyContext context) { var link = (Link)context.PropertyValue; link.Url = _urlRewriter.GetFriendlyUrl(link.Url, context.ExecutionContext.RequestContext, RouteTable.Routes); }