問題:
ビルド時に次のエラーが発生します。
「'.Controllers.ControllerBase' には、引数を 0 個取るコンストラクターが含まれていません」
私のベースコントローラーは次のようになります。
public abstract class ControllerBase : Controller
{
public CompanyChannel<IAuthorizationService> authorizationServiceClient;
public ControllerBase(CompanyChannel<IAuthorizationService> authService)
{
this.authorizationServiceClient = authService;
}
}
Base..を利用するコントローラーの例。
public partial class SearchController : ControllerBase
{
protected CompanyChannel<IComplaintTaskService> complaintTaskServiceChannel;
protected IComplaintTaskService taskServiceClient;
protected ComplaintSearchViewModel searchViewModel;
#region " Constructor "
public SearchController(CompanyChannel<IComplaintTaskService> taskService, CompanyChannel<IAuthorizationService> authService, ComplaintSearchViewModel viewModel)
: base(authService)
{
searchViewModel = viewModel;
this.complaintTaskServiceChannel = taskService;
this.taskServiceClient = complaintTaskServiceChannel.Channel;
}
#endregion
public virtual ActionResult Index()
{
return View();
}
}
これは T4MVC をトリップしているようです。
基本コンストラクターにパラメーターを渡してはいけませんか?