{"id":25661963,"url":"https://github.com/locktar/eventuous-dotnet-sample-sqlserver","last_synced_at":"2026-05-16T09:32:01.384Z","repository":{"id":245297334,"uuid":"806629739","full_name":"LockTar/eventuous-dotnet-sample-sqlserver","owner":"LockTar","description":null,"archived":false,"fork":false,"pushed_at":"2024-06-21T11:15:17.000Z","size":68,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-06-22T07:51:42.469Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/LockTar.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-05-27T15:08:49.000Z","updated_at":"2024-06-21T11:15:20.000Z","dependencies_parsed_at":"2024-06-21T07:48:42.813Z","dependency_job_id":"689b2c7d-fd07-4248-a02f-17fa04bfbeab","html_url":"https://github.com/LockTar/eventuous-dotnet-sample-sqlserver","commit_stats":null,"previous_names":["locktar/eventuous-dotnet-sample-sqlserver"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LockTar%2Feventuous-dotnet-sample-sqlserver","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LockTar%2Feventuous-dotnet-sample-sqlserver/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LockTar%2Feventuous-dotnet-sample-sqlserver/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LockTar%2Feventuous-dotnet-sample-sqlserver/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/LockTar","download_url":"https://codeload.github.com/LockTar/eventuous-dotnet-sample-sqlserver/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240414796,"owners_count":19797595,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-02-24T03:33:02.574Z","updated_at":"2025-11-17T09:03:13.645Z","avatar_url":"https://github.com/LockTar.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Bookings sample application - SQL Server\n\nThis projects shows some of the features of Eventuous:\n\n- Event-sourced domain model using `Aggregate` and `AggregateState`\n- Aggregate persistence using SQL ServerQL\n- Read models in SQL Server\n- Integration between services using messaging (RabbitMQ)\n\n## Prerequisites\n\n- Create a new SQL Server database `Bookings` and run the script `Create-Tables.sql` to create the necessary tables for the projections.\n\n## Usage\n\n- Open the `app.http` file in Visual Studio and execute the commands to interact with the API.\n- You can also use SwaggerUI to interact with the API.\n- Create a booking by executing the `booking/book` api.\n- Record a payment by executing the `booking/recordPayment` api.\n- Get the booking state by executing the `bookings` api.\n- Get the booking projection by executing the `projections/sql/bookings` api.\n\n\u003c!-- Start the infrastructure using Docker Compose from the repository root:\n\n```bash\ndocker compose up\n```\n\nRun both `Bookings` and `Bookings.Payments` projects and then open `http://localhost:5051/swagger/index.html` and `http://localhost:5000/swagger/index.html` respectively.\nHere you can use SwaggerUI to initiate commands that will result in events being raised. --\u003e\n\n### Example commands\n\n#### Bookings -\u003e BookRoom (`/bookings/book`)\n\n- This command raises an event, which gets stored in the database.\n- A real-time subscription triggers a projection, which adds or updates two records in SQL Server:\n  - one for the booking\n  - one for the guest\n\n#### Bookings.Payments -\u003e RecordPayment (`/recordPayment`)\n\n- When this command is executed, it raises a `PaymentRecorded` event, which gets persisted to the database.\n- A gateway inside the Payments service subscribes to this event and publishes an integration event to RabbitMQ.\n- An integration RabbitMQ subscription receives the integration event and calls the Bookings service to execute the `RecordPayment` command, so it acts as a Reactor.\n- When that command gets executed, it raises a `PaymentRecorded` event, which gets persisted to the database. It might also raise a `BookingFullyPaid` or `BookingOverpaid` events, depending on the amount.\n- Those new events are projected to SQL Server document in the `Bookings` collection using the read-model subscription.\n\n```mermaid\ngraph TB\n    HTTP --\u003e RecordPayment\n    subgraph Payments \n    direction LR\n    RecordPayment -- aggregate --\u003e PaymentRecorded[PaymentRecorded\u003cbr\u003edomain event]\n    Reactor --\u003e PR[PaymentRecorded\u003cbr\u003eintegration event]\n    end\n    subgraph SQL Server\n    PaymentRecorded -- eventstore --\u003e SQLSERVER[(SQL SERVER)]\n    SQLSERVER -- gateway --\u003e Reactor\n    end\n    subgraph Broker\n    PR --\u003e RabbitMQ[[RabbitmQ]]\n    end\n    subgraph Bookings\n    direction RL\n    RabbitMQ -- subscription --\u003e IH[Integration\u003cbr\u003ehandler]\n    IH --\u003e RP[RecordPayment]\n    RP -- aggregate --\u003e PR1[PaymentRecorded]\n    PR1 -- eventstore --\u003e SQLSERVER\n    SQLSERVER -- subscription --\u003e Projections\n    end\n    subgraph SQL Server\n    Projections --\u003e BC[(BookingState)]\n    Projections --\u003e MB[(MyBookings)]\n    end\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flocktar%2Feventuous-dotnet-sample-sqlserver","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flocktar%2Feventuous-dotnet-sample-sqlserver","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flocktar%2Feventuous-dotnet-sample-sqlserver/lists"}