Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ControllerTypeExtensions ControllerName should look for ControllerBase #16186

Closed
Skrypt opened this issue May 28, 2024 · 3 comments · Fixed by #16187
Closed

ControllerTypeExtensions ControllerName should look for ControllerBase #16186

Skrypt opened this issue May 28, 2024 · 3 comments · Fixed by #16187
Labels

Comments

@Skrypt
Copy link
Contributor

Skrypt commented May 28, 2024

ControllerTypeExtensions ControllerName should look for ControllerBase type instead of Controller.

if (!typeof(Controller).IsAssignableFrom(controllerType))
{
throw new ArgumentException($"The specified type must inherit from '{nameof(Controller)}'", nameof(controllerType));
}

ApiController should also inherit from ControllerBase instead of Controller.

@Skrypt
Copy link
Contributor Author

Skrypt commented Jun 4, 2024

Yes, ControllerBase here should support both.

@Skrypt
Copy link
Contributor Author

Skrypt commented Jun 5, 2024

@sebastienros Unless what you meant is that I should revert the change so that we can keep the ControllerBase as clean as possible? It just feels wrong to me to need to inherit from Controller on an ApiController. And I was not really into creating another inheritance on top of ControllerBase just for this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants