How do I test a type parameter is of a certain type?

How do I test whether a type parameter T is of a certain type. I need it so I that I can write something like the following:

using (var db = new NorthwindEntities()) { if (T is Categories) { _data = db.Categories.ToList(); } } 

Where _data is List<T>

submitted by /u/luitzenh
[link] [comments]

Leave a Reply