IntentArchitect / Support

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

List of the Class Models #6

Closed leonAtRain closed 1 year ago

leonAtRain commented 1 year ago

Ask a question

At this specific point, I need to compare DTO's from the Service APi with the Classes from the Domain API, to achieve this I pull a list of domain classes, and send it through to my template, by doing this: _metadataManager.Domain(outputTarget.Application).GetClassModels() - but the outputTarget.Application is showing that it would be deprecated going forward, and provides me with an alternative - which is the application name, and in this situation that would not work for me. Do you have an alternative how I can get a list of Domain Classes in my Template? or alternative to the outputTarget's deprecated property?

garethbaars commented 1 year ago

Hi @leonAtRain,

You can access the Domain Classes anywhere in a template in the following way:

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

You will just need to have the Intent.Modules.Modelers.Domain NuGet package installed in that Module.

Let us know if that doesn't meet your rquirements.

leonAtRain commented 1 year ago

This is perfect - it would solve a few troublesome workarounds I've been doing and it also resolves the issue around the Application parameter. Thank you this solves my problem