Last post Aug 06, 2017 12:53 PM by Dmitry Sikorsky
Aug 05, 2017 04:12 PM|rogue1nib|LINK
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
[TypeForwardedFrom("System.Web.Routing, Version=220.127.116.11, 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
I no I will need a controler like CmsController with the pages and actions to write the field that will house the content what is the best way also to output the content to the view these days is it still output to something like a litterial control?
Aug 06, 2017 12:53 PM|Dmitry Sikorsky|LINK
I think this is what you need: https://www.hanselman.com/blog/AddingACustomInlineRouteConstraintInASPNETCore10.aspx