Answers for "'The route template separator character '/' cannot appear consecutively. It must be separated by either a parameter or a literal value. Parameter name: routeTemplate'"

C#
0

'The route template separator character '/' cannot appear consecutively. It must be separated by either a parameter or a literal value. Parameter name: routeTemplate'

In my case, I had an extra '/' on my Route query string.

LIKE:

[Route("get/liked//{id}")]
[HttpGet("[action]")]
public async dynamic GetLikedPost(int id)

INSTEAD OF:

[Route("get/liked/{id}")]
[HttpGet("[action]")]
public async dynamic GetLikedPost(int id)
Posted by: Guest on August-26-2020

Code answers related to "'The route template separator character '/' cannot appear consecutively. It must be separated by either a parameter or a literal value. Parameter name: routeTemplate'"

C# Answers by Framework

Browse Popular Code Answers by Language