3

I want to use lowercase URLs in my app and I can see there's a RouteOptions object documented here:

https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.routing.routeoptions?view=aspnetcore-5.0

But how do you actually use RouteOptions?

I thought it would be something similar to the below, but it just generates a compiler warning saying that app.UseRouting() doesn't take any parameters:

app.UseRouting(options => {
    options.<no intellisense>
});

So can someone please let me know where I can specify RouteOptions?

1 Answer 1

5

You need to configure this in your ConfigureServices method, for example:

services.Configure<RouteOptions>(options =>
{
    options.LowercaseUrls = true;
});
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.