Skip to content

Commit

Permalink
Merge pull request #2 from erikshafer/renaming_projects
Browse files Browse the repository at this point in the history
Renaming .NET Projects
  • Loading branch information
erikshafer authored May 22, 2024
2 parents 9452226 + b0186ec commit 3ec281c
Show file tree
Hide file tree
Showing 20 changed files with 41 additions and 25 deletions.
22 changes: 19 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,44 @@

An application showing the absolute basics of event sourcing with [EventStoreDB (ESDB)](https://www.eventstore.com/).


## 💡 Inspiration

Inspired by Nick Chapsas' video about [getting started with Event Sourcing in .NET](https://www.youtube.com/watch?v=n_o-xuuVtmw). This take however uses EventStoreDB as its, well, store of events!

### 🤔 Mini-Log / Thoughts / Brian Dump

- **2024-May-21**:
### 📄 Mini-Log / 🤔 Thoughts / 🧠 Brain Dump

This is not an Architectural Decision Records (ADRs) log. [This is just a tribute 🎶🎸](https://www.youtube.com/watch?v=Vdq3BtWDRq8).

<details>
<summary><strong>2024-May-21</strong></summary>
- For clarity, renamed the .NET console application projects.
</details>
<details>
<summary><strong>2024-May-21</strong></summary>
- Updated some code, fixed some bugs and typos.
- Decided this repository will have multiple versions.
- One that works nearly the same as Nick's original in-memory incarnation.
- Another using ESDB and some of the most frequently used commands with the ESDB .NET client.
- Could have a potential third version if there is some demand from the community.
- Would appreciate feedback. That and questions could extend this even further, perhaps.
- **2024-May-20**:
</details>
<details>
<summary><strong>2024-May-20</strong></summary>
- Watched Nick's initial video. Awesome. Wait, what if we did the same thing, but with ESDB?
- Made this code repository and .NET solution.
- Only the bare bones as of this commit. Will update to include some event sourcing best practices without "getting into the weeds" too much.
</details>


## 📺 Companion Video

A video will be posted on my [YouTube channel](https://www.youtube.com/@event-sourcing) soon.

Ideally on my birthday, May 22nd!


## 🐋 Requirements

1. [Docker](https://www.docker.com/products/docker-desktop/)
Expand Down Expand Up @@ -89,6 +103,7 @@ dotnet run --project .\StudentEnrollment01\StudentEnrollment01.csproj

Instructions will go here, but will basically be the same as above!


## 🔗 Resources

Erik Shafer (me):
Expand All @@ -101,6 +116,7 @@ Nick Chapsas:
- [youtube.com/@nickchapsas](https://www.youtube.com/@nickchapsas) - YouTube channel
- [Dometrain](https://dometrain.com/) - Courses crafted by real engineers for the real world.


## License

To Be Determined.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace StudentEnrollment00.Events;
namespace StudentEnrollment01.InMemory.Events;

public abstract class Event
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace StudentEnrollment00.Events;
namespace StudentEnrollment01.InMemory.Events;

public class StudentCreated : Event
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace StudentEnrollment00.Events;
namespace StudentEnrollment01.InMemory.Events;

public class StudentEnrolled : Event
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace StudentEnrollment00.Events;
namespace StudentEnrollment01.InMemory.Events;

public class StudentUnEnrolled : Event
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace StudentEnrollment00.Events;
namespace StudentEnrollment01.InMemory.Events;

public class StudentUpdated : Event
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using StudentEnrollment00.Events;
using StudentEnrollment01.InMemory.Events;

namespace StudentEnrollment00;
namespace StudentEnrollment01.InMemory;

public sealed class InMemoryDatabase
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using StudentEnrollment00;
using StudentEnrollment00.Events;
using StudentEnrollment01.InMemory;
using StudentEnrollment01.InMemory.Events;

var id = Guid.Parse("a662d446-4920-415e-8c2a-0dd4a6c58908");
var now = DateTime.Now;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using StudentEnrollment00.Events;
using StudentEnrollment01.InMemory.Events;

namespace StudentEnrollment00;
namespace StudentEnrollment01.InMemory;

public class Student
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace StudentEnrollment01.Events;
namespace StudentEnrollment02.Esdb.Events;

public abstract record Event
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using System.Collections.Concurrent;

namespace StudentEnrollment01.Events;
namespace StudentEnrollment02.Esdb.Events;

public class EventTypeMapper
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace StudentEnrollment01.Events;
namespace StudentEnrollment02.Esdb.Events;

public record StudentCreated : Event
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace StudentEnrollment01.Events;
namespace StudentEnrollment02.Esdb.Events;

public record StudentEmailChanged : Event
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace StudentEnrollment01.Events;
namespace StudentEnrollment02.Esdb.Events;

public record StudentEnrolled : Event
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace StudentEnrollment01.Events;
namespace StudentEnrollment02.Esdb.Events;

public record StudentWithdrawn : Event
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using System.Text;
using System.Text.Json;
using EventStore.Client;
using StudentEnrollment01.Events;
using StudentEnrollment02.Esdb.Events;

// Register events to a singleton for ease-of-reference
EventTypeMapper.Instance.ToName(typeof(StudentCreated));
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using StudentEnrollment01.Events;
using StudentEnrollment02.Esdb.Events;

namespace StudentEnrollment01;
namespace StudentEnrollment02.Esdb;

public class Student
{
Expand Down
4 changes: 2 additions & 2 deletions StudentEnrollmentConsoleApp.sln
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

Microsoft Visual Studio Solution File, Format Version 12.00
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "StudentEnrollment01", "StudentEnrollment01\StudentEnrollment01.csproj", "{446FF6B7-B58B-4CFB-8E98-C5B3AED9BA4D}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "StudentEnrollment02.Esdb", "StudentEnrollment02.Esdb\StudentEnrollment02.Esdb.csproj", "{446FF6B7-B58B-4CFB-8E98-C5B3AED9BA4D}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{43721FA4-09D5-4B98-9684-8752B40047AD}"
ProjectSection(SolutionItems) = preProject
Expand All @@ -10,7 +10,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
README.md = README.md
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "StudentEnrollment00", "StudentEnrollment00\StudentEnrollment00.csproj", "{B8D543AF-F986-4E50-AD1D-492B38A58ECF}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "StudentEnrollment01.InMemory", "StudentEnrollment01.InMemory\StudentEnrollment01.InMemory.csproj", "{B8D543AF-F986-4E50-AD1D-492B38A58ECF}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down

0 comments on commit 3ec281c

Please sign in to comment.