Skip to main content

arolariu.Backend.Core

arolariu.Backend.Core

arolariu.Backend.Core Namespace

Classes

Log Class

Provides source-generated, zero-allocation logging methods for the Core project. Covers application startup, middleware pipeline, general domain configuration, and health checks.

internal static class Log

Inheritance System.Object 🡒 Log

Remarks

Event ID scheme for the Core project:

  • 500_1xx — Application startup and domain configuration
  • 500_2xx — Middleware pipeline and request processing
  • 500_3xx — Health checks and infrastructure probes

Methods

Log.LogApplicationStarted(this ILogger, string, string) Method

Logs the application startup summary with environment details.

public static void LogApplicationStarted(this Microsoft.Extensions.Logging.ILogger logger, string environment, string hostName);

Parameters

logger Microsoft.Extensions.Logging.ILogger

environment System.String

hostName System.String

Log.LogGeneralDomainConfigurationCompleted(this ILogger) Method

Logs that the general domain configuration phase completed successfully.

public static void LogGeneralDomainConfigurationCompleted(this Microsoft.Extensions.Logging.ILogger logger);

Parameters

logger Microsoft.Extensions.Logging.ILogger

Log.LogGeneralDomainConfigurationStarted(this ILogger) Method

Logs that the general domain configuration phase has started.

public static void LogGeneralDomainConfigurationStarted(this Microsoft.Extensions.Logging.ILogger logger);

Parameters

logger Microsoft.Extensions.Logging.ILogger

Log.LogHealthCheckCompleted(this ILogger, string, double) Method

Logs a health check probe result.

public static void LogHealthCheckCompleted(this Microsoft.Extensions.Logging.ILogger logger, string status, double durationMs);

Parameters

logger Microsoft.Extensions.Logging.ILogger

status System.String

durationMs System.Double

Log.LogHealthChecksRegistered(this ILogger, string) Method

Logs that health check endpoints have been registered.

public static void LogHealthChecksRegistered(this Microsoft.Extensions.Logging.ILogger logger, string healthPath);

Parameters

logger Microsoft.Extensions.Logging.ILogger

healthPath System.String

Log.LogInvoicesDomainConfigured(this ILogger) Method

Logs that the Invoices domain configuration has been applied.

public static void LogInvoicesDomainConfigured(this Microsoft.Extensions.Logging.ILogger logger);

Parameters

logger Microsoft.Extensions.Logging.ILogger

Log.LogOTelConfigured(this ILogger) Method

Logs that OpenTelemetry signal providers have been configured.

public static void LogOTelConfigured(this Microsoft.Extensions.Logging.ILogger logger);

Parameters

logger Microsoft.Extensions.Logging.ILogger

Log.LogPipelineConfigurationCompleted(this ILogger) Method

Logs that the general application pipeline configuration completed.

public static void LogPipelineConfigurationCompleted(this Microsoft.Extensions.Logging.ILogger logger);

Parameters

logger Microsoft.Extensions.Logging.ILogger

Log.LogPipelineConfigurationStarted(this ILogger) Method

Logs that the general application pipeline configuration has started.

public static void LogPipelineConfigurationStarted(this Microsoft.Extensions.Logging.ILogger logger);

Parameters

logger Microsoft.Extensions.Logging.ILogger

Log.LogProxyConfigurationFetchCompleted(this ILogger, int) Method

Logs that the proxy configuration fetch completed and how many keys were loaded.

public static void LogProxyConfigurationFetchCompleted(this Microsoft.Extensions.Logging.ILogger logger, int keyCount);

Parameters

logger Microsoft.Extensions.Logging.ILogger

keyCount System.Int32

Log.LogProxyConfigurationFetchFailed(this ILogger, Exception, string) Method

Logs a failure during proxy configuration fetch.

public static void LogProxyConfigurationFetchFailed(this Microsoft.Extensions.Logging.ILogger logger, System.Exception exception, string proxyEndpoint);

Parameters

logger Microsoft.Extensions.Logging.ILogger

exception System.Exception

proxyEndpoint System.String

Log.LogProxyConfigurationFetchStarted(this ILogger, string) Method

Logs that the proxy configuration fetch from the exp service has started.

public static void LogProxyConfigurationFetchStarted(this Microsoft.Extensions.Logging.ILogger logger, string proxyEndpoint);

Parameters

logger Microsoft.Extensions.Logging.ILogger

proxyEndpoint System.String

Log.LogSecurityHeadersInjected(this ILogger, string) Method

Logs that security headers middleware has injected headers into a response.

public static void LogSecurityHeadersInjected(this Microsoft.Extensions.Logging.ILogger logger, string requestPath);

Parameters

logger Microsoft.Extensions.Logging.ILogger

requestPath System.String

Log.LogSwaggerConfigured(this ILogger, string) Method

Logs that Swagger/OpenAPI endpoints have been configured.

public static void LogSwaggerConfigured(this Microsoft.Extensions.Logging.ILogger logger, string swaggerPath);

Parameters

logger Microsoft.Extensions.Logging.ILogger

swaggerPath System.String

Program Class

Represents the main entry point for the arolariu.ro backend API. This class configures and bootstraps a .NET 9.0 STS (Standard Terms Support) modular monolith web application that provides invoice management and authentication services.

internal static class Program

Inheritance System.Object 🡒 Program

Remarks

The application follows a modular monolith architecture pattern with clearly separated domains:

  • General domain: Core infrastructure, configuration, and cross-cutting concerns
  • Invoices domain: Business logic for invoice processing, analysis, and management
  • Authentication domain: User authentication and authorization services

The application is designed for deployment as a containerized service on Microsoft Azure, utilizing Azure services for storage, configuration, monitoring, and AI capabilities.

Configuration is applied in two phases:

  1. Builder configuration: Sets up services, dependencies, and middleware
  2. Application configuration: Configures the request pipeline and routing

Methods

Program.Main(string[]) Method

The main entry point for the application. Configures and starts the web application with all required domains and services.

public static void Main(string[] args);

Parameters

args System.String[]

Command-line arguments passed to the application. These are used by the ASP.NET Core host for configuration overrides, environment specification, and other runtime parameters. Common arguments include --environment, --urls, and custom configuration keys.

Remarks

The startup sequence follows this order:

  1. Create WebApplicationBuilder with default configuration sources
  2. Add general domain configuration (logging, telemetry, health checks, etc.)
  3. Add invoices domain configuration (business services, database contexts, etc.)
  4. Build the WebApplication instance
  5. Configure general application pipeline (middleware, routing, etc.)
  6. Configure invoice domain pipeline (endpoints, authorization policies, etc.)
  7. Start the application host

Each domain is responsible for registering its own services and configuring its own middleware through extension methods, promoting separation of concerns and modularity.

// was this page useful?