ConnectSoft Libraries¶
The ConnectSoft Libraries are a suite of modular tools designed to streamline application development within the .NET Core ecosystem. They are integrated into the ConnectSoft templates and adhere to industry standards and best practices, ensuring scalability, maintainability, and efficiency.
Introduction¶
Purpose¶
The libraries provide foundational components for building scalable and maintainable applications. Each library targets specific aspects of application development, such as persistence, messaging, globalization, and logging.
Framework Compatibility¶
All libraries are multi-targeted and support both .NET 8 and .NET 9, ensuring compatibility with the latest .NET runtime versions. Some libraries (such as ConnectSoft.Extensions.AspNetCore) also support earlier versions like .NET 6.
Core Principles¶
- Modularity: Focused, reusable components for targeted functionality.
- Cloud-Native Alignment: Optimized for containerized and distributed environments.
- Standardization: Designed to promote best practices across projects.
Library Categories¶
Utility Libraries¶
ConnectSoft.Extensions¶
- Provides extensions for common .NET Core classes, including strings, dates, and numbers.
ConnectSoft.Extensions.Globalization¶
- Adds globalization utilities, including support for the Jewish calendar and Hebrew character analysis.
ConnectSoft.Extensions.DataAnnotations¶
- Extends the DataAnnotations framework with additional validation attributes and utilities.
ConnectSoft.Extensions.Options¶
- Provides a standardized extension method for registering and validating options with dependency injection.
- Eliminates code duplication across libraries and templates.
- Supports configuration binding, DataAnnotations validation, and custom validators.
ConnectSoft.Extensions.Localization¶
- Provides reusable localization functionality for .NET applications.
- Strongly-typed configuration with validation.
- Automatic registration of localization services and middleware.
- Supports multiple cultures, parent culture fallback, and response header culture application.
Database and Persistence¶
ConnectSoft.Extensions.DatabaseModel¶
- Provides abstractions for managing and creating database instances.
Database-Specific Implementations¶
- ConnectSoft.Extensions.DatabaseModel.MySql: MySQL support.
- ConnectSoft.Extensions.DatabaseModel.PostgreSQL: PostgreSQL support.
- ConnectSoft.Extensions.DatabaseModel.SqlServer: SQL Server support.
ConnectSoft.Extensions.PersistenceModel¶
- Implements repository, Unit of Work, specification, and query patterns.
Database-Specific Persistence¶
- ConnectSoft.Extensions.PersistenceModel.MongoDb: MongoDB-specific persistence with repository, unit of work, specification patterns, transaction support, and migration framework.
- ConnectSoft.Extensions.PersistenceModel.NHibernate: NHibernate-specific persistence.
ConnectSoft.Extensions.PersistenceModel.DependencyInjection¶
- Provides dependency injection utilities for persistence components.
Domain and Entity Management¶
ConnectSoft.Extensions.EntityModel¶
- Supports Domain-Driven Design (DDD) constructs such as entities, value objects, aggregates, and enumerations.
ConnectSoft.Extensions.DomainModel¶
- Provides abstractions for domain services and use case contracts.
ConnectSoft.Extensions.DomainModel.Impl¶
- Implements domain services and use case contracts.
Messaging and Communication¶
ConnectSoft.Extensions.MessagingModel¶
- Provides abstractions for messaging and service bus communication.
Messaging Implementations¶
- ConnectSoft.Extensions.MessagingModel.MassTransit:
- MassTransit-based messaging.
- ConnectSoft.Extensions.MessagingModel.NServiceBus:
- NServiceBus-based messaging, with DI extensions and header propagation.
Logging and Transactions¶
ConnectSoft.Extensions.Logging¶
- Adds enhanced logging features, including invocation context logging and method entry/exit logging.
ConnectSoft.Extensions.Transactions¶
- Simplifies transaction management with commit and rollback functionalities.
Security and Compliance¶
ConnectSoft.Extensions.Compliance¶
- Provides data classification and redaction capabilities for PII and sensitive data.
- Includes custom redactors for email, phone, payment cards, JWT tokens, IP addresses, GUIDs, and secrets.
- Integrates with structured logging to automatically redact sensitive data in log messages.
- Supports configurable redaction profiles (default, audit, strict) for different compliance requirements.
Diagnostics and Health Checks¶
ConnectSoft.Extensions.Diagnostics.HealthChecks¶
- Provides shared building blocks for implementing .NET health checks.
- Includes
DelegateHealthCheckfor lightweight health checks without dedicated classes. - Offers validated options and minimal dependencies for health check infrastructure.
Health Check Implementations¶
- ConnectSoft.Extensions.Diagnostics.HealthChecks.SignalR:
- SignalR-specific health checks for monitoring hub connectivity.
- Automatic hub URL discovery and configurable connection options.
- ConnectSoft.Extensions.Diagnostics.HealthChecks.Orleans:
- Orleans-specific health checks for monitoring cluster, silo, grain, and storage health.
- Includes health checks for Azure Table Storage clustering and Blob Storage grain persistence.
Service Models¶
ConnectSoft.Extensions.ServiceModel¶
- Encapsulates service communication abstractions such as fault contracts.
ConnectSoft.Extensions.ServiceModel.Grpc¶
- Provides gRPC-based service communication, including a code-first approach, exception handling, interceptors, and Brotli compression support.
ConnectSoft.Extensions.ServiceModel.Grpc.Client¶
- Provides gRPC client implementation for consuming gRPC services with code-first approach support.
Web and JSON Utilities¶
ConnectSoft.Extensions.AspNetCore¶
- Provides ASP.NET Core extensions including Server-Timing middleware for performance metrics, AJAX request detection, and local request identification utilities.
ConnectSoft.Net.Http¶
- Enhances HttpClient functionality in .NET Core.
ConnectSoft.Text.Json¶
- Provides extensions and utilities for working with JSON using
System.Text.Json.
Pipeline and CI/CD¶
ConnectSoft.AzurePipelines¶
- Offers reusable YAML templates for Azure DevOps pipelines.
Integration with Templates¶
All libraries are pre-integrated into the ConnectSoft templates, streamlining their usage in various architectural styles:
- Microservices:
- Uses persistence and messaging libraries for modular and scalable services.
- SaaS Platforms:
- Leverages persistence and globalization libraries for multi-tenant systems.
- Event-Driven Systems:
- Integrates messaging libraries for event sourcing and asynchronous processing.
- Enterprise Platforms:
- Combines logging, transactions, service models, compliance, and health checks for robust enterprise solutions.
- Compliance-Critical Applications:
- Leverages compliance libraries for PII protection and audit-ready logging.
- High-Availability Systems:
- Integrates health checks for proactive monitoring and reliability assurance.
Benefits¶
- Time-Saving: Eliminates boilerplate code and accelerates development.
- Standardization: Promotes consistent practices across projects.
- Flexibility: Modular design allows selective usage based on project needs.
- Interoperability: Seamlessly integrates with other frameworks and tools.
References¶
- NuGet Packages:
- Templates Documentation:
- Explore templates in the Templates.md file for pre-configured solutions using these libraries.