NeVeSpl / NTypewriter

File/code generator using Scriban text templates populated with C# code metadata from Roslyn API.
https://nevespl.github.io/NTypewriter/
MIT License
126 stars 24 forks source link

FR: Symbols.ThatDerivesFrom filter #14

Closed gregveres closed 3 years ago

gregveres commented 3 years ago

Hi,

Now that I have all the Enums and Interfaces being generated, the next step is to generate my services from my controllers. All of my controllers are derived from a single base class. It would be great if there was a Symbols filter that selected classes that were derived from a base class rather than having to find all the controllers.

This is especially important for me because I am still on ASP.Net MVC (haven't had time to re-write for .Net Core), so all of my API Controllers and my MVC Controllers end with the word Controller. So using a name filter doesn't really work. I am hoping I can capture just the right set of controllers through the namespace, but the best would be to filter by a derived class.

Thanks!

NeVeSpl commented 3 years ago

That functionality already exists, but it is exposed with Types prefix. Types.ThatInheritFrom

gregveres commented 3 years ago

Ah, thanks for the pointer. I was only looking at the Symbols functions. Sorry about the noise.