My Case(I get compile error because T undefined):
public void f1(Dictionary<string,T> d){
}
How Can I solve the problem(I cant pass Object i have to pass original var type)?
(I am using .net 4.5)
Thanks
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You need to add the type parameter
T:If you want the dictionary to contain values of any type then your only option is to use a
Dictionary<string, object>and cast as appropriate.