I want to convert a list of any type to a generic type list? [closed]

-2

I want a list of a certain type to become a list of a single type: examples

List<usuarios> se transformar em uma List<T> 

I do not know if this is possible Or a Maize List turn a Lista<T> The reason for this is that I have a method that only accepts listas<T> I wanted it to accept anything ...

    
asked by anonymous 05.10.2018 / 20:28

1 answer

1

Own List<T> is already generic, you only have to type the Type as List<string> for example and it will have a generic list. If you need a list that accepts any type you can use the ArrayList or the List itself by passing Object to type ( List<Object> ).

    
05.10.2018 / 20:42