I have been working on migrating an application from obsolete DNX to ASP.NET Core 2.0. While doing so it found that there has been few changes in the namespaces and APIs like Microsoft.AspNet
to Microsoft.AspNetCore
. Though I have been able to find and fix most of the changes, the below one is causing issue for me:
In class inherited from Route
, within RouteAsync(RouteContext context)
method, with DNX it was context.IsHandled = true;
, how do I signify that this has been handled now with ASP.NET Core 2.0?
I have tried to find change history from GitHub but there seems to be none related to this.
It is no longer necessary to call
context.IsHandled
fromRouteAsync
. The framework knows to skip to the next route if youreturn
with noTask
. If you return a task, then the framework will process (handle) it.Old DNX / MVC6 / Preview Code
New .NET Core 1.x / .NET Core 2.x Code
Full code here (updated for .NET Core 1/2): Change route collection of MVC6 after startup