0

I have an enumerable as follows:

IEnumerable<SomeObjectType> dataToImport;

At runtime I run the following code:

dataToImport.GetType().ToString()

So far so good. Checking results at runtime shows me something like the following :

System.Collections.Generic.List`1[SomeObjectType]

Can somebody tell me what that `1 means and where it is coming from? Should I expect this on all collections?

MHOOS
  • 5,146
  • 11
  • 39
  • 74

2 Answers2

1

It's a placeholder for the first generic type argument. You should expect it on anything with a generic type.

Joel Coehoorn
  • 399,467
  • 113
  • 570
  • 794
1

The backtick(`) followed by a digit represent the number of generic arguments. For example List<T> has one generic argument hence `1

Borka
  • 803
  • 5
  • 16