0
假設我有這樣的如何在具有構造函數的類上使用Unity實現DI - mvc?
public interface ILienholderBusinessService
{
string GetCoverage(IList<PolicyVinRequest> InputList);
}
public class LienholderBusinessService : ILienholderBusinessService
{
public ILienholderPolicySearchDataService LienholderPolicySearchDataService { get; set; }
public LienholderBusinessService(ILienholderPolicySearchDataService LienholderPolicySearchDataService)
{
this.LienholderPolicySearchDataService =LienholderPolicySearchDataService ;
}
public string GetCoverage(IList<PolicyVinRequest> InputList)
{
return "my string";
}
}
一個接口和類我有這樣
public class InsuranceVerificationPortalController : Controller
{
public ILienholderBusinessService LienholderBusinessService { get; set; }
public InsuranceVerificationPortalController(ILienholderBusinessService LienholderBusinessService)
{
this.LienholderBusinessService = LienholderBusinessService;
}
}
控制器現在,當我試圖實現我的MVC團結,我得到錯誤,如
你是否缺少任何類型
如何在具有構造函數的類上實現使用Unity的DI