-
|
Can relation components have fields to provide more context to relation, like that: If yes, how can i setup it? Since mapper provides only ability to set target entity: |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
|
Hi @dvoyni, |
Beta Was this translation helpful? Give feedback.
Hi @dvoyni,
yes, relation components can have additional fields as in your example. These fields are handled just like in normal components, so you can e.g. initialize them when adding the component with
MapX.AddorMapX.AddFn. Or you get the component using a query or mapper, and set fields by simple assignment. Note that theSetRelationsmethod is only for changing targets of components that were already added, and does not allow to change field values in the same operation.