Closed leonAtRain closed 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.
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
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 theoutputTarget.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?