Quantcast
Channel: ASP.NET Core
Viewing all articles
Browse latest Browse all 9386

IrouteConstraint how to do in asp.net.core

$
0
0

I am trying to create a IrouteConstraint for a cms controller to match on slugs. However I am using asp.net core and I cant seem to find a way to resolve httpcontextbase. I was going by the msdn

https://msdn.microsoft.com/en-us/library/system.web.routing.irouteconstraint(v=vs.110).aspx

[TypeForwardedFrom("System.Web.Routing, Version=3.5.0.0, Culture=Neutral, PublicKeyToken=31bf3856ad364e35")]
public interface IRouteConstraint
{
    bool Match(HttpContextBase httpContext, Route route, string
    parameterName, RouteValueDictionary values, RouteDirection routeDirection);
}

Obv I cannot reference system.web as its not in asp.net core so what do I reference in asp.net core 1.2 to get this to work or is their a new way of doing this.

Basically what I want to achieve is www.yourdoamin.com / friendly url then if a person choose a parent category it would go www.yourdomain.com/category/friendlyurl cms driven page.

Base in mind im using lattest asp.net core


Viewing all articles
Browse latest Browse all 9386

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>