<p>Hej, </p>

<p>assuming I have a code that looks like this:</p>

<pre><code>List&lt;User&gt; userList = GetUserByName (u =&gt; u.Name == name);
DoSomethingWithTheUsers (userList.ToArray ());
</code></pre>

<p>Now I want to know the type of the objects in the Array in the method <em>DoSomethingWithTheUsers (object[] myObjects)</em></p>

<p>Simply done by <em>myObjects.First ().GetType ()</em> but what is to be done if the array is empty?
Is there a possibility to still get the Type?</p>

The array type will be an array of User, i.e. User[]. Why not just use Type.GetElementType() on the GetType() of the array? I.e. using your example:
```
```
myObjects.GetType().GetElementType()
```
```