MasLazu.AspNet.Authentication.Core.Consumer 1.0.0-preview.10

This is a prerelease version of MasLazu.AspNet.Authentication.Core.Consumer.
dotnet add package MasLazu.AspNet.Authentication.Core.Consumer --version 1.0.0-preview.10
                    
NuGet\Install-Package MasLazu.AspNet.Authentication.Core.Consumer -Version 1.0.0-preview.10
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="MasLazu.AspNet.Authentication.Core.Consumer" Version="1.0.0-preview.10" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="MasLazu.AspNet.Authentication.Core.Consumer" Version="1.0.0-preview.10" />
                    
Directory.Packages.props
<PackageReference Include="MasLazu.AspNet.Authentication.Core.Consumer" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add MasLazu.AspNet.Authentication.Core.Consumer --version 1.0.0-preview.10
                    
#r "nuget: MasLazu.AspNet.Authentication.Core.Consumer, 1.0.0-preview.10"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package MasLazu.AspNet.Authentication.Core.Consumer@1.0.0-preview.10
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=MasLazu.AspNet.Authentication.Core.Consumer&version=1.0.0-preview.10&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=MasLazu.AspNet.Authentication.Core.Consumer&version=1.0.0-preview.10&prerelease
                    
Install as a Cake Tool

MasLazu.AspNet.Authentication.Core.Consumer

This project contains the event consumers for the MasLazu ASP.NET Authentication Core library.

Overview

The MasLazu.AspNet.Authentication.Core.Consumer project provides:

  • Event Consumers: MassTransit consumers for handling authentication-related events
  • Event-Driven Processing: Asynchronous processing of verification and authentication events
  • Extensions: Dependency injection and MassTransit registration extensions

Key Consumers

  • VerificationCompletedConsumer: Handles VerificationCompletedEvent to verify user emails upon successful verification

Key Components

  • ServiceCollectionExtensions: Extensions for registering consumers in DI and MassTransit

Project Configuration

  • Target Framework: .NET 9.0
  • Implicit Usings: Enabled
  • Nullable Reference Types: Enabled

Dependencies

  • Package References:

    • MasLazu.AspNet.Verification.Abstraction - Verification event models
    • MassTransit - Message bus for event handling
    • Microsoft.Extensions.DependencyInjection - DI container
  • Project References:

    • MasLazu.AspNet.Authentication.Core.Abstraction - Service interfaces

Usage

Register the consumers in your application's DI container and MassTransit configuration:

// Register consumers in DI
services.AddAuthenticationCoreConsumers();

// Configure MassTransit
busConfigurator.AddAuthenticationCoreConsumers();

The consumers will automatically handle events published to the message bus.

Event Flow

  1. Verification service publishes VerificationCompletedEvent
  2. VerificationCompletedConsumer receives the event
  3. If verification is successful, updates user email verification status
  4. User email is marked as verified in the database

🛠️ Development Guidelines

Naming Conventions

  • Consumers: Suffix with Consumer (e.g., VerificationCompletedConsumer)
  • Extensions: Suffix with Extensions (e.g., ServiceCollectionExtensions)
  • Event Handlers: Follow MassTransit IConsumer<TEvent> pattern

Code Structure

src/MasLazu.AspNet.Authentication.Core.Consumer/
├── Consumers/             # MassTransit event consumers
├── Extensions/            # DI and MassTransit extensions
├── MasLazu.AspNet.Authentication.Core.Consumer.csproj
└── README.md

Best Practices

  • Implement IConsumer<TEvent> for event handling
  • Use dependency injection for service dependencies
  • Handle exceptions appropriately in consumer logic
  • Follow async/await patterns for database operations
  • Include proper logging for event processing

🤝 Contributing

  • New Consumers: Implement IConsumer<TEvent> for new event types
  • Event Handling: Add business logic for processing events
  • Registration: Update extensions to register new consumers
  • Testing: Add integration tests for consumer behavior
  • Error Handling: Implement retry and dead letter queue patterns

📄 License

Part of the MasLazu ASP.NET framework ecosystem.

Product Compatible and additional computed target framework versions.
.NET net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.0-preview.10 145 10/8/2025
1.0.0-preview.9 140 10/2/2025
1.0.0-preview.8 139 10/1/2025
1.0.0-preview.7 137 10/1/2025
1.0.0-preview.5 138 9/29/2025
1.0.0-preview.3 269 9/18/2025

See RELEASES.md for release notes.