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

Sample project for Getting Started #53

Merged
merged 2 commits into from
Dec 5, 2024
Merged

Conversation

christianhelle
Copy link
Member

This pull request includes significant changes to the sample project to implement a CQRS (Command Query Responsibility Segregation) pattern using the Atc.Cosmos.EventStore.Cqrs library. The most important changes include the addition of new commands, events, and projections, as well as the configuration of the Cosmos DB and Event Store.

The getting started project is described in detail in a year old blog post I wrote on https://christianhelle.com/2024/02/atc-cosmos-eventstore-cqrs.html

Commands Implementation:

  • Added CreateCommand, DeleteCommand, and UpdateNameCommand along with their respective handlers to handle the creation, deletion, and updating of entities. (sample/GettingStarted/Commands/CreateCommands.cs, sample/GettingStarted/Commands/DeleteCommand.cs, sample/GettingStarted/Commands/UpdateNameCommands.cs) [1] [2] [3]

Events Implementation:

  • Added new event classes: AddedEvent, AddressChangedEvent, DeletedEvent, and NameChangedEvent to represent domain events. (sample/GettingStarted/Events/AddedEvent.cs, sample/GettingStarted/Events/AddressChangedEvent.cs, sample/GettingStarted/Events/DeletedEvent.cs, sample/GettingStarted/Events/NameChangedEvent.cs) [1] [2] [3] [4]

Projections and Read Models:

  • Implemented SampleProjection to update the read model based on the events. Added SampleReadModel to represent the read model and ContainerInitializer to initialize the Cosmos DB container. (sample/GettingStarted/Projections/SampleProjection.cs, sample/GettingStarted/Projections/SampleReadModel.cs, sample/GettingStarted/Projections/ContainerInitializer.cs) [1] [2] [3]

Configuration and Setup:

  • Configured Cosmos DB and Event Store in Program.cs and added a ConsoleHostedService to execute commands. (sample/GettingStarted/Program.cs, sample/GettingStarted/ConsoleHostedService.cs) [1] [2]

Cleanup:

  • Removed outdated configuration files such as .editorconfig, directory.build.props, and directory.build.targets. (sample/.editorconfig, sample/directory.build.props, sample/directory.build.targets) [1] [2] [3]

@christianhelle christianhelle added the documentation Improvements or additions to documentation label Dec 5, 2024
@LarsSkovslund LarsSkovslund merged commit 3e09337 into main Dec 5, 2024
1 check passed
@LarsSkovslund LarsSkovslund deleted the getting-started-docs branch December 5, 2024 12:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants