c# Reflection - Find the Generic Type of a Collection
- by Andy Clarke
Hi,
I'm reflecting a property 'Blah' its Type is ICollection
public ICollection<string> Blah { get; set; }
private void button1_Click(object sender, RoutedEventArgs e)
{
var pi = GetType().GetProperty("Blah");
MessageBox.Show(pi.PropertyType.ToString());
}
This gives me (as you'd expect!)…