In c#, can we determine what type a List is holding before doing something else? Example:
List<int> listing = new List<int>();
if(listing is int)
{
// if List use <int> type, do this...
}
else if(listing is string)
{
// if List use <string> type, do this...
}
You can use
Type.GetGenericArguments()method.Like: