Skip to Content
View all events

CQRS and Event Sourcing in .NET

Published by Pearson

Intermediate content levelIntermediate

Refactor and Modernize an Existing Application using CQRS, Event Sourcing, and DDD Patterns

  • Refactor an existing application toward CQRS and Event Sourcing step by step by following along with live demos
  • Go beyond the theory and focus on how to build an event-sourced system in C#
  • Learn modern design patterns and architecture commonly used in microservices architectures via a hands-on approach

This class takes your existing Command Query Responsibility Segregation (CQRS), Event Sourcing, and Domain-Driven Design knowledge to the next level. CQRS and Event Sourcing are gaining popularity because they attack genuine challenges in today’s software development. The instructor will walk you through refactoring a sample application toward these patterns and explain the various design decisions we make in each step.

You will be provided with the complete code for each step in this class, so you can follow along and explore the various refactorings that the instructor applies to the sample project. By the end of the course, you will learn how to implement DDD style aggregates, capture your domain using commands and events, query your events, separating reads and writes, and persist your event in an event store.

What you’ll learn and how you can apply it

By the end of the live online course, you’ll understand:

  • How CQRS, Event Sourcing, and DDD can improve your architecture
  • Modernizing a legacy application using these design patterns
  • Ways to capture your business domain in your applications better

And you’ll be able to:

  • Persist your application data with Event Sourcing
  • Improve your existing applications using the patterns and techniques introduced in this class
  • Introduce commands and events as first-class concepts in your application
  • Separate reads and writes using the CQRS design pattern

This live event is for you because...

  • You are a developer who wants to learn how to write a system using the CQRS and Event Sourcing patterns
  • You're a practicing software architect who wants to hone your skills and learn new software architecture techniques and practices
  • You want to learn how to modernize an existing legacy application
  • You're currently struggling with a large monolithic system and you want to learn new ways to architecture an application

Prerequisites

  • Know the fundamentals of object orientation, generics, LINQ, reflections, and lambda expressions in C#.
  • A basic understanding of CQRS, Event Sourcing, and Domain-Driven Design concepts.

Course Set-up

  • If you want to follow along with the demos during class, then you need to have Visual Studio 2022 installed.
  • Installation instructions and the source code of the sample application can be found on the course GitHub repository

Recommended Preparation

Recommended Follow-up

Schedule

The time frames are only estimates and may vary according to how the class is progressing.

Part 1 – CQS and the CQRS pattern (70 minutes)

  • Introduction
  • Demo - Introduction
  • Introducing the CQS principle
  • Demo - Introducing the CQS principle
  • Applying CQRS pattern
  • Demo - Applying CQRS pattern
  • Replacing methods with command objects
  • Demo - Replacing methods with command objects
  • Q/A
  • Break

Part 2 - Aggregate and events (50 minutes)

  • Adding the write service
  • Demo - Adding the write service
  • Introducing the aggregate
  • Demo - Introducing the aggregate
  • Adding events to describe what happened in the system
  • Demo - Adding events
  • Q/A
  • Break

Part 3 - Event sourcing (50 minutes)

  • Storing events
  • Demo - Storing events
  • Introduction to event sourcing
  • Demo - Introduction to event sourcing
  • Introduction to event sourcing – part 2
  • Demo - Introduction to event sourcing – part 2
  • Q/A
  • Break

Part 4 - Queries (70 minutes)

  • Querying our aggregate
  • Demo - Querying our aggregate
  • Adding read side projections
  • Demo - Adding read side projections
  • Using the projections
  • Demo - Using the projections
  • Summary
  • Q/A

Your Instructor

  • Tore Nestenius

    Tore Nestenius is an independent software consultant and trainer based in Helsingborg, Sweden, with more than 30 years of experience in IT. Tore has been training and helping developers in the areas of software architecture, web security, and .NET/C# since 2010. To learn more about Tore and their projects, visit TN Datakonsult and Stackoverflow.

    linkedinXlinksearch

Skill covered

.NET