我有一个基本控制器:
Public MustInherit Class InjuredWorkerController(Of TManager As IInjuredWorkerManagerBase)
然后我有一个家庭控制器:
Public Class HomeController
Inherits InjuredWorkerController(Of IInjuredWorkerManager)
IInjuredWorkerManager
继承IInjuredWorkerManagerBase
为什么这会引发强制转换异常:
Dim manager = CType(filterContext.Controller, InjuredWorkerController(Of IInjuredWorkerManagerBase)).Manager
无法将“MyClaim.Controllers.HomeController”类型的对象转换为“MyClaim.Controllers.InjuredWorkerController`1[SAIF.Web.Mvc.MyClaim.IInjuredWorkerManagerBase]”。