Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ContentRepository: Add overloads to patch update commands #497

Closed
HeyJoel opened this issue Feb 21, 2022 · 1 comment
Closed

ContentRepository: Add overloads to patch update commands #497

HeyJoel opened this issue Feb 21, 2022 · 1 comment

Comments

@HeyJoel
Copy link
Member

HeyJoel commented Feb 21, 2022

It would be handy if you could patch an update command and execute it in a single operation e.g. by calling contentRepository.MyEntity.UpdateAsync(command => command.Title = "New Title"); whereby the command is initialized with existing data and the lambda function allows you to alter any properties you want to change.

@HeyJoel
Copy link
Member Author

HeyJoel commented Feb 21, 2022

Fixed, will be release in v0.10.

  • All patchable commands in the content repository have been updated to have an overload with the new patching format
  • A new method IDomainRepository.PatchCommandAsync() can be used to execute generic patchable commands

In doing this the following changes have been made:

  • A new set of interfaces IPatchableCommand and IPatchableByIdCommand has been added which need to be implemented by command to indicate that it is patachable. This is really a marker interface and it just means that you've added the companion query handler to get the patchable command.
  • GetUpdateCommandQuery has been renamed GetPatchableCommandQuery and moved to the Cofoundry.Domain.CQS` namespace.
  • GetUpdateCommandByIdQuery has been renamed GetPatchableCommandByIdQuery and moved to the Cofoundry.Domain.CQS` namespace.

@HeyJoel HeyJoel closed this as completed Feb 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant