IntentArchitect / Support

A repository dedicated to handling issues and support queries
3 stars 0 forks source link

Listing use cases for services in sub folders #18

Closed Laura-BSC closed 1 year ago

Laura-BSC commented 1 year ago

Ask a question

We have a module to generate documentation for our use cases and domain entities. One of my projects has the use cases split into folders so the use cases aren't picked up. Is there a way to easily traverse the folder structure and get a list of all use cases? 2023-05-15 09_29_00-Intent Architect __ BSC Group _ Microsoft Teams

JonathanLydall commented 1 year ago

Hi @Laura-BSC,

The same metadata manager that one uses from TemplateRegistrations is also accessible in Templates themselves from ExecutionContext.MetadataManager and it can be used to get all models of a type. For example, you could get all the classes from the Domain Designer by going:

var classes = OutputTarget.ExecutionContext.MetadataManager
    .Domain(OutputTarget.ExecutionContext.GetApplicationConfig().Id)
    .GetClassModels();

You would just need to use the correct extension methods to get your custom UseCase element type.

Let me know if you need more detail 🙂.