C# Get generic non-array type from generic array type

Given the following function;

This works fine, yet sometimes the function fails before T passed is an array type, yet it mustn’t be an array type. These functions have to do with JSON deserialization of a dictionary, yet for some reason it doesn’t accept the T array argument when the dictionary has only one entry.

In short, I want to do this

I’ve tried a ton of stuff, & I realize the real problem is somewhere else, yet I need to temporary fix this so I can work on a real solution in the deserializer. I tried reflection too using the following method;

But that doesn’t quite work either.

Thank you!

I am not really sure what you are trying to achieve here, yet to obtain the type of the elements in an array, you have to use Type.GetElementType():