Custom component
Custom component type is used to add logic for the ‘custom’ processing of entities in read or write pipelines.
For example, if you need to change a certain property based on user’s identity or if you would like to precalculate specific property values before storing the entity to a database, the best place to implement that logic is in the custom component.
It is possible to define multiple custom components in pipelines, but they have to be named differently.
This example shows definiton of three custom components, named Rock
, Paper
and Scissors
:
Configuration
solutionName: "Axellon.Entity.Demo"
dataApi:
entityGroups:
- group: default
enableHistory: false
enableTransactions: false
readComponents:
- type: MongoDbComponent
- type: CustomComponent
configuration:
name: Rock
writeComponents:
- type: ValidationComponent
- type: CustomComponent
configuration:
name: Paper
- type: CustomComponent
configuration:
name: Scissors
- type: MongoDbComponent
endpoints:
- type: WebApiEndpoint