Route of Controller works only on lowercase

I have a controller, i removed all the data from it leaving a simple Index action with a parameterless view return. The thing is the following, i have a definition of my controller

[AuthorizeExtension]
public class TasksController : Controller
{
    private readonly ApplicationDbContext _db = new ApplicationDbContext( );

    public string CurrentUserId => User.Identity.GetUserId( );

    // GET: Tasks
    public ActionResult Index( )
    {
        var data = RouteTable.Routes.GetRouteData( HttpContext );

        return View(  );
    }
}

Once upon a time i could access it by localhost/Tasks .Now if i try the same url, i get redirected to the login view (that's what authorizeExtension does if i'm not logged in) while i am logged in, but it does work on lower case accessing localhost/tasks, same goes for sub pages index,create,details etc. Other pages work while this one doesn't. I also tried duplicating it with a new controller with same views, it works, but if i do the following

[AuthorizeExtension]
[RoutePrefix("Tasks")]
public class EmptyController : Controller
{
    private readonly ApplicationDbContext _db = new ApplicationDbContext( );

    public string CurrentUserId => User.Identity.GetUserId( );

    // GET: Tasks
    [Route("Index")]
    public ActionResult Index( )
    {
        var data = RouteTable.Routes.GetRouteData( HttpContext );

        return View( );
    }
}

again i get redirected. I have attached a print screen within the authorizationExtensionm with the HttpContext.User I'm loosing my identity.

Answers


I found the problem after hitting the the issue the second time, it was actually a misplacement of keys in the database, going back to a working migration did the trick.


Need Your Help

how to call service from receiver

android

In my application I want to call service from Receiver.

Executing SQL function for each row in the table

sql sql-server-2008 function

I have implemented a SQL function and I want to execute it for every row returning from a table. For simplicity, let’s assume that a function accepts @StudentId as parameter and returns a table/mul...