I have same classes but in different namespaces. ex: x.InHeaderType, y.InHeaderType etc...
I have to create instances of these classes with same parameters frequently.
Here is a sample:
x.InHeaderType inHeader = new x.InHeaderType();
inHeader.CompanyId = "TEST";
inHeader.UserId = "TEST";
inHeader.Password = "TEST";
inHeader.MessageId = " ";
Is it possible to create a method like:
public static T GetInHeaderProperty<T>()
{
T value;
// fill the properties of object and return the instance of T
// I will call it when I need x.InHeaderType or y.InHeaderType
}
Thanks in advance,