dotnet / dotnet/aspnetcore

Support interface as controller

Open
#25,802 5 comments 2 reactions 0 assignees View on GitHub
affected-very-few area-mvc enhancement feature-mvc-application-model Needs: Attention :wave: severity-minor
Dominant language
C#
Stars
38.4k
Forks
10.9k
Avg merge
2d 10h
Merged PRs (30d)
281

Description

I am trying to mark a interface as Controller, but in DefaultApplicationModelProvider.CreateControllerModel throw a NullReferenceException
![image](https://user-images.githubusercontent.com/7077224/92856548-22eb4500-f426-11ea-831d-7f9b38f17da8.png)

interface 's BaseType is null, so throw exception.

If currentTypeInfo is Interface ,you can break this cycle. let me use IControllerModelConvention to set the route or other feature.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.