This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
ES.FX (EmberStack Framework) is a comprehensive collection of extensions and application frameworks for .NET. It provides reusable components for building enterprise-grade applications with built-in observability, resilience, and clean architecture patterns.
# Build the solution
dotnet build
dotnet build --configuration Release
# Run all tests
dotnet test --verbosity normal
# Run tests for a specific project
dotnet test tests/ES.FX.Tests/ES.FX.Tests.csproj
# Clean build artifacts
dotnet clean# Create NuGet packages (automatically done during build for ES.FX.* projects)
dotnet pack
# Restore packages
dotnet restore# Run API playground
dotnet run --project playground/Playground.Microservice.Api.Host
# Run worker playground
dotnet run --project playground/Playground.Microservice.Worker.Host
# Run test SUTs for manual testing
dotnet run --project tests/ES.FX.Ignite.AspNetCore.HealthChecks.UI.Tests.SUT# Format code
dotnet format
# Run code analysis
dotnet build /p:RunAnalyzers=true
# Run a single test
dotnet test --filter "FullyQualifiedName~TestClassName.TestMethodName"
# Run tests with detailed output
dotnet test --logger "console;verbosity=detailed"-
ES.FX - Core abstractions and primitives
IMessenger,IMessage,IMessageHandler- Messaging abstractionsResult<T>- Result pattern for error handlingProblem- Standardized error representationOptional<T>- Nullable value handling
-
ES.FX.Additions.* - Extensions for third-party libraries
- MassTransit - Message bus integration
- MediatR - Mediator pattern with batch processing
- FluentValidation - Validation with Problem pattern
- Microsoft.EntityFrameworkCore - EF Core utilities
-
ES.FX.Hosting - Application lifecycle management
ProgramEntry- Structured program entry with error handling- Graceful shutdown and logging integration
-
ES.FX.Ignite - Opinionated application framework
- Built-in OpenTelemetry, health checks, resilience
- Spark components for service integrations (Redis, SQL Server, Azure services, etc.)
-
ES.FX.TransactionalOutbox - Outbox pattern implementation
- Reliable message delivery with EF Core
- Automatic message capture via interceptors
-
ES.FX.Migrations - Database migration abstractions
- Migration engine with dependency injection support
- Support for multiple migration providers
- Builder Pattern - Used for configuration (e.g.,
ProgramEntryBuilder) - Options Pattern - All configurations use
IOptions<T> - Extension Methods - Clean API surface
- Dependency Injection - All components designed for DI
- Modular Architecture - Each component can be used independently
- All projects target .NET 9.0
- Warnings are treated as errors (
TreatWarningsAsErrors=true) - Nullable reference types are enabled (
Nullable=enable) - Implicit usings are enabled (
ImplicitUsings=enable) - XML documentation is generated for all projects
- Build artifacts output to
.artifacts/directory - Test results output to
.artifacts/TestResultsin TRX format
- Unit tests use xUnit
- Functional tests use Testcontainers for Redis and SQL Server
- Test projects follow naming convention:
{ProjectName}.Tests - SUT (System Under Test) projects for integration testing
- Namespaces:
ES.FX.{Component}.{SubComponent} - Spark components:
ES.FX.Ignite.Spark.{ServiceName} - Test fixtures:
{Service}Fixture(e.g.,RedisFixture,SeqContainerFixture)
- Create project in appropriate folder (src/ES.FX.*)
- Follow existing project structure and naming
- Add corresponding test project
- Use central package management (Directory.Packages.props)
- Implement health checks where applicable
- Add OpenTelemetry instrumentation if relevant
- Create project:
src/ES.FX.Ignite.Spark.{ServiceName} - Create configuration class:
{ServiceName}SparkConfig - Create hosting extensions:
{ServiceName}SparkHostingExtensions - Implement health checks if applicable
- Add tests in
tests/ES.FX.Ignite.Spark.{ServiceName}.Tests
- Add
ES.FX.TransactionalOutbox.Microsoft.EntityFrameworkCorereference - Configure in DbContext with
UseTransactionalOutbox() - Messages are automatically captured when saving changes
- Use
OutboxDeliveryServicefor message delivery
Directory.Build.props- Global build configurationDirectory.Packages.props- Central package versionsES.FX.slnx- Solution structureGitVersion.yaml- Versioning configuration.github/workflows/pipeline.yaml- CI/CD pipeline
- Automated builds on push/PR
- Semantic versioning with GitVersion
- Publishes to GitHub Packages and NuGet.org
- Creates GitHub releases automatically
- Path filters optimize build times
Currently available Spark components for service integration:
- ApplicationInsights - Azure Application Insights telemetry
- AzureKeyVault - Azure Key Vault configuration provider
- AzureServiceBus - Azure Service Bus messaging
- AzureStorage - Azure Storage services (Blobs, Queues, Tables)
- Dapr - Dapr distributed application runtime
- Redis - Redis caching and distributed locking
- Seq - Seq structured logging
- SqlServer - SQL Server with EF Core integration
Each Spark component follows a consistent pattern with:
{Service}SparkConfigfor configuration{Service}SparkHostingExtensionsfor service registration- Built-in health checks where applicable
- OpenTelemetry instrumentation support