In asp.net mvc is it possible to make a generic controller?

前端 未结 5 1121
生来不讨喜
生来不讨喜 2020-11-29 01:51

I\'m attempting to create a generic controller, ie:

public class MyController : Controller where T : SomeType
{ ... }

However, whe

5条回答
  •  挽巷
    挽巷 (楼主)
    2020-11-29 02:25

    If i was you, i'd get the MVC source and create a test MVC project with the source code so you can examine where the exception is generated and see what you can do about your generic idea and the enforced "*controller" naming convention.

提交回复
热议问题