我有帶兩個類型參數中的第一個是具有我通過其類型作爲第二個參數的項目的列表的類的通用方法:如何將未定義數量的類型參數傳遞給泛型方法?
public static TJCls GetComplexLog<TJCls, TListObj>(int logIds) where TJCls : ISplitList<TListObj>
{
//here I deserialize the string from DB to TJCls, and deserialize List<string>
//from DB to List<TListObj> and set the TJCls's list via the ISplitList's SetList method:
log.SetList(lst);
}
但現在的對象可以具有多於一個的列表(未知號碼),所以有沒有辦法我可以通過任何數量的類型參數,如params