You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Love your template and is trying i out for myself (without MediatR for now). I ran into an "issue" that i dont have a good approach to.
If the Request Object in the Commands solution is a more complicated Object, like one that has a property with a list of custom objects.
How would you pass that list to the command? Would you:
Just pass along the entire request object to the command (i assume this is bad practice since Commands belong to the Presentation layer)
Create a custom intermediate model in the Application layer and map the list of custom objects to that one (i went with this one for now)
Skip the contract and Let the Caller of the api provide the actual command
Rethink the presentation layer to have api endpoint with a smaller contract
Something else?
My solution for context (i am talking about the list if Items):
The Api
The Contract
The text was updated successfully, but these errors were encountered:
I also face this challenge. According to best practices, domain objects should remain valid at all times. While it's convenient to place DTOs in the domain layer to facilitate conversion at the application layer and streamline command creation, this approach creates a dependency between the domain assembly and the ACL, which is not permissible. Therefore, should DTO objects be included in the domain assembly solely for convenience.
Somewhere a string is getting converted to a domain model which means the domain assembly knows about strings and other primitive types so why not have DTOs, then I can do the following in the application layer. UpdateShoppingListCommand.TryCreate(updateShoppinglistRequestDto)
Hi Amichai,
Love your template and is trying i out for myself (without MediatR for now). I ran into an "issue" that i dont have a good approach to.
If the Request Object in the Commands solution is a more complicated Object, like one that has a property with a list of custom objects.
How would you pass that list to the command? Would you:
My solution for context (i am talking about the list if Items):
The Api
The Contract
The text was updated successfully, but these errors were encountered: