Skip to content
This repository was archived by the owner on Dec 14, 2018. It is now read-only.
This repository was archived by the owner on Dec 14, 2018. It is now read-only.

When replacing Controller.Dispose with an explicit implementation the base Dispose is an action #5352

@rynowak

Description

@rynowak
public class HomeController : Controller, IDisposable
{
        void IDisposable.Dispose()
        {
            Debug.WriteLine("Got disposed");
        }
}

If you define this controller, then /Home/Dispose will be routed to the Controller.Dispose() method and will call it as an action.

Note that this requires you to reimplement IDisposable on the subclass. Just overriding the protected void Dispose() would not have any deleterious impact.

This is a similar case that also reproduces the bug:

public class HomeController : Controller
{
        public new void Dispose()
        {
            Debug.WriteLine("Got disposed");
        }
}

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions