Can someone help me to see why my condition is not working? To get more clear, i wish get a T type and see if this type is a string[]. In my code bellow is not matching the types, anyone can say to me what i doing wrong?
public T GetTotalMemoryValue<T>()
{
object result = null;
result = typeof(T);
if(result.GetType() == typeof(string[]))
{
Convert.ChangeType(result, typeof(string[]));
try
{
...
}
return (T)(object) buffer;
}
}
buffer is a string array.