1

I need to check if the types that have the name terminating with "Repository" derives from a base class called "DefaultRepositoryBase".

I've searched but I' ve not been able to find how to get the IType from a known type...how can I achieve this and then pass it to the t.DerivesFrom(itype)

from  t in Application.Types
where t.NameLike("Repository")
select t
advapi
  • 3,661
  • 4
  • 38
  • 73

1 Answers1

1

You can write

t.DerivesFrom("Namespace.TypeName")

or you can write something like

let baseType = Application.Types.WithFullName("Namespace.TypeName").Single()
...
t.DerivesFrom(baseType)
Patrick from NDepend team
  • 13,237
  • 6
  • 61
  • 92