How to aggregate entity by input a entity name?
Application Type

I want to aggregate a static entity records,  and the entity name is variable which will be input as a parameter, becase the static  entity may not be created.  how i can do this?

e.g I want to create aggregate like GetNameById(entityname, id) , If entityname is set to "ProductStatic Entity" , it will be query ProductStaticEntity by id, If entityname is set to "BookStatic Entity" , it will be query BookStatic Entity by id.


I am not getting proper your question can you please more elaborate.

Or what i understand as per this you can create one static entity and add new attribute it

below is the image hope this will help you.

Please elaborate more so i can help you again.



Hello liu dan 

As far as i understood your question you dont want to set an entity as fixed source of an aggregate you want aggregate to dynamically fetch records from whatever entity name you provide in input.

Now, that is not possible with aggregates. You need to write your own logic for that and have to use two separate aggregates one of each source entity,now whichever entity name you provide your logic will determine to use which aggregate.

This might be a solution.

Thank & regards


Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.