0Pricing
C# Academy · Lesson

Notifications and Events

Publish domain events with MediatR.

Requests vs Notifications

A request has one handler and returns a value. A notification is a broadcast: it has zero or more handlers and returns nothing. Use notifications to announce that something happened.

// Request:      one handler, returns a result
// Notification: many handlers, fire-and-forget

INotification

A domain event is a record implementing INotification. It describes a fact in the past tense.

public record OrderPlacedNotification(int OrderId, int CustomerId)
    : INotification;

All lessons in this course

  1. CQRS Concepts
  2. Commands and Handlers with MediatR
  3. Pipeline Behaviors
  4. Notifications and Events
← Back to C# Academy