一个抽象类继承了一个接口,然后这个抽象类具有多种实现方式,我该如何注入?
界面:
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
Number : <input maxlength="8" type="number" name="quantity" id="quantity" />
抽象类:
public interface IStatementsDetailService<T> : IApplicationService where T : ReportFinancialStatementsDetailItem, new()
{
/// <summary>
/// 获取销账明细
/// </summary>
/// <param name="requestDto"></param>
/// <returns></returns>
Task<ReportFinancialStatementsDetailDto<T>>
ReportFinancialStatementsDetail(ReportFinancialStatementsDetailRequest requestDto);
}
A:
public abstract class StatementsDetailBaseService<T> : FanjiaFinancialSystemAppServiceBase, IStatementsDetailService<T> where T : ReportFinancialStatementsDetailItem, new(){
public abstract Task<ReportFinancialStatementsDetailDto<T>> ReportFinancialStatementsDetail(ReportFinancialStatementsDetailRequest requestDto);
}
B:
public class MICEVisaStatementsDetailService : StatementsDetailBaseService<MICEVisaItem>{
public async override Task<ReportFinancialStatementsDetailDto<MICEVisaItem>> ReportFinancialStatementsDetail(ReportFinancialStatementsDetailRequest requestDto){
}
}
这是我在模块中的注射:
public class FlightStatementsDetailService : StatementsDetailBaseService<FlightDetailItem>{
public async override Task<ReportFinancialStatementsDetailDto<FlightDetailItem>> ReportFinancialStatementsDetail(ReportFinancialStatementsDetailRequest requestDto){
}
}
但是不能用