Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR TYPESCRIPT

c# check type implements generic interface

bool isBar = foo.GetType().GetInterfaces().Any(x =>
  x.IsGenericType &&
  x.GetGenericTypeDefinition() == typeof(IBar<>));
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #check #type #implements #generic #interface
ADD COMMENT
Topic
Name
4+6 =