0
我想創建一個使用Tuple.Create()
與Tuple<String,String,Func<String,Control>>
與多參數功能建立的元組
類型簽名的元組,但是當我做;我得到的錯誤:
The type arguments for method 'Tuple.Create<T1,T2,T3>(T1,T2,T3)'
cannot be inferred from the usage. Try specifying the types explicitly.
這裏是我的代碼片段:
public List<Tuple<String, String, Func<string,Control>>> Headers { get; set; } = new List<Tuple<String, String, Func<string,Control>>> {
Tuple.Create("Name","Type", TypeControl),
Tuple.Create("Age","TypeAge", AgeControl),
};
public Control TypeControl(string data = ""){
// code returns a Control
}
public Control AgeControl(string data = ""){
// code returns a Control
}
我要做到這一點使用Tuple.Create()
是有可能不new Tuple<T1,T2,T3>(T1,T1,T3)