0
If we declare a List
, we are sure that your type is explicitly the System.Collections.Generic.List<T>
.
But when we declare one array? What is the generic type implemented behind it?
Example:
string[] objeto = {"Olá,", " mundo!"};
When we get the Type.FullName
of objeto
, we have a "System.String[]"
as output, but no type that implements or inherits the class. This does not clarify anything about.
Just like a List<>
, arrays also has native functions and methods.
The question is, what class do these methods come from? Basically, I need to know if a type T[]
there is some class, structure or interface implementable and changeable by type, so that it is possible to make an explicit statement, for example:
public void foo(string[] array) { ... }
...
System.Collections.Generic.TipoAnonimo<string> bar = {"foo", "bar"};
foo(bar); // OK
Observing: I don’t intend to use LINQ in these operations.
Have you checked the documentation? if not, take a look at it and see if it helps... https://docs.microsoft.com/pt-br/dotnet/api/system.array?view=netframework-4.8
– Lodi
@Lodi I read, but found nothing saying that
Byte[]
could be converted to an Array.– CypherPotato