Closed alinsky-afk closed 5 months ago
Hi @alinsky-afk,
We don't presently have a mapping configuration which could be used to describe this requirement, but you can still model the command's contract and then implement the handler code manually.
For example, if you wanted to bulk create Customers
as per the following:
Create a DTO, with a name such as CreateCustomerDto
, with the Fields you need:
Then create a Command with a name such as CreateCustomersCommand
, add a Customers
Field to it set to CreateCustomerDto
and ensure you have set Is Collection for it:
Run the Software Factory and it will generate a stub for you, you can then just implement the logic you need in there:
I've also logged a feature request for us possibly adding support for this kind of use case to our modules, however, as our resources are a bit limited at the moment, I can't say when we might be able to implement it.
Please don't hesitate to let me know if you have any additional comments or questions.
Thanks @JonathanLydall this worked just fine! 🔥
Ask a question
Hi All,
Is it possible to create a custom command that accepts a list of items? For example I would like to mass insert records to a table and I would like pass a list as a parameter. Instead of looping through a list and making a single create request for each. I've attached a screenshot below for just an idea of what I want.
Thanks!