I'm using MVC 5, I have this url:
/Joes-studio-essex
This is 2 seperate params {business}-{county}
Q1) How can i write a route to split this out??
Q2) Can anyone think of a way to deal with this url '/joes-studio-west-yorkshire', where the county is 'west-yorkshire' ?
Thanks
There's no way for MVC to determine how to split up that string so you have to do it yourself. Create an action method with this signature:
Inside the function, you can then do the splitting up of the string manually. Note this is completely untested and is virtually psuedo code so needs fixing and lots of error handling adding:
So now your controller looks something like this: