Answer the question
In order to leave comments, you need to log in
How to pass an unknown class to a method with properties in c#?
An example of how you can pass an unknown class to a method.
public static void ReadData<T>() where T : new(){
T i = new T();
}
public static void ReadData<T>() where T : new(){
T i = new T{
params1 = "hello"
};
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question