What's the difference between:
typeof(IInterface).IsAssignableFrom(typeof(Class));
and
typeof(Class) is IInterface
?
Edit: for context, my function is something like this:
public static List<T> GetAllInstancesOfType<T>() where T:Entity
{
List<T> l = new List<T>();
if (typeof(IMyInterface).IsAssignableFrom(typeof(T)) //or (typeof(T) is IMyInterface)
foreach(Entity e in List1) if (e is T) l.Add(e as T);
else foreach (Entity e in List2) if (e is T) l.Add(e as T);
return l;
}