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
> Note: The code adds service registrations for typed collections based on types found in the [sample code](https://github.com/Cratis/Samples/tree/main/Chronicle/Quickstart/Common).
96
127
97
128
With this you can now quite easily create a type that encapsulates getting the data that takes a specific collection as a dependency:
Next, we want to append a couple of events to represent books being added to our inventory:
33
49
34
-
{{snippet:Quickstart-DemoData-Books}}
50
+
```csharp
51
+
awaiteventLog.Append(Guid.NewGuid(), newBookAddedToInventory("Metaprogramming in C#: Automate your .NET development and simplify overcomplicated code", "Einar Ingebrigtsen", "978-1837635429"));
52
+
awaiteventLog.Append(Guid.NewGuid(), newBookAddedToInventory("Understanding Eventsourcing: Planning and Implementing scalable Systems with Eventmodeling and Eventsourcing", "Martin Dilger", "979-8300933043"));
The method `Added` is not defined by the `IReducerFor<>` interface. The `IReducerFor<>` interface serves as a marker interface for discovery purposes.
106
166
It requires a generic argument specifying the type of the read model. Chronicle uses this type to gather information about properties and types for the underlying database.
@@ -131,12 +191,37 @@ and one-to-one. When your goal is to produce state, projections will often be su
131
191
132
192
Let's start by defining a read model that will be used in the projection.
With this projection, we specify that from the `BookBorrowed` event, we are interested in storing which user borrowed the book and the time it was borrowed.
142
227
The time is derived from the `Occurred` property of the `EventContext`. For display purposes, we want to show the name of the book and the name of the user
0 commit comments