BAYSOFT.Abstractions
10.0.3
dotnet add package BAYSOFT.Abstractions --version 10.0.3
NuGet\Install-Package BAYSOFT.Abstractions -Version 10.0.3
<PackageReference Include="BAYSOFT.Abstractions" Version="10.0.3" />
<PackageVersion Include="BAYSOFT.Abstractions" Version="10.0.3" />
<PackageReference Include="BAYSOFT.Abstractions" />
paket add BAYSOFT.Abstractions --version 10.0.3
#r "nuget: BAYSOFT.Abstractions, 10.0.3"
#:package BAYSOFT.Abstractions@10.0.3
#addin nuget:?package=BAYSOFT.Abstractions&version=10.0.3
#tool nuget:?package=BAYSOFT.Abstractions&version=10.0.3
BAYSOFT.Abstractions 
BAYSOFT.Abstractions is a core .NET library developed by BAYSOFT, providing abstraction layers and foundational interfaces for building clean architecture, domain-driven design and application services in C# (.NET).
It supports projects leveraging CQRS, MediatR, FluentValidation and other modern patterns.
π Overview
In enterprise or modular .NET applications, it's beneficial to define abstraction layers that decouple infrastructure from domain and application logic.
BAYSOFT.Abstractions provides:
- Common base interfaces and marker types for commands, queries, results and domain services.
- Contract definitions (abstractions) for application layers β enabling greater testability and adherence to dependency inversion.
- Patterns following CQRS + MediatR + FluentValidation, allowing you to build application logic with consistency and minimal boilerplate.
- A shared library to reduce duplication, enforce uniform architecture and accelerate new service development.
β Key Features
- Core abstractions for Commands (
ICommand), Queries (IQuery<TResult>), and Handlers (ICommandHandler<TCommand>,IQueryHandler<TQuery, TResult>). - Integration friendly with libraries such as
MediatR,FluentValidation, and other modular frameworks. - Helps define contracts (interfaces) in the Application layer, keeping dependencies one-way (inward) and domain logic clean.
- Published as a NuGet package
BAYSOFT.Abstractions
π Installation
Using NuGet Package Manager
Install-Package BAYSOFT.Abstractions
Using .NET CLI
dotnet add package BAYSOFT.Abstractions
π» Example Usage
Hereβs a minimal example to illustrate how you might use the abstractions in your application layer:
// Define a command
public class CreateOrderCommand : ICommand<OrderResult>
{
public string CustomerId { get; set; }
public List<OrderItemDto> Items { get; set; }
}
// Define handler
public class CreateOrderHandler : ICommandHandler<CreateOrderCommand, OrderResult>
{
public async Task<OrderResult> Handle(CreateOrderCommand command, CancellationToken ct)
{
// business logic, domain work, persistence, etc.
...
return new OrderResult { OrderId = createdOrder.Id, Success = true };
}
}
Because these types leverage the abstractions from BAYSOFT.Abstractions, the infrastructure (e.g., MediatR, dependency injection) and application layers can remain loosely coupled and maintainable.
π Documentation & Resources
- GitHub Repository:
https://github.com/BAYSOFT-001/baysoft-abstractions - NuGet Package Info:
https://www.nuget.org/packages/BAYSOFT.Abstractions - Versioning:
π‘ Why Use This Library?
- Keeps your architecture consistent across multiple services or microservices.
- Helps maintain separation of concerns: infrastructure, application logic, domain.
- Makes code easier to test, evolve and scale.
- Provides a standard foundation for new services, reducing startup overhead.
π§ Best Practices
- Use the abstractions in the Application layer only. Do not reference infrastructure implementation details here.
- Keep domain entities and business rules inside the Domain layer; abstractions here help the boundary but do not replace domain logic.
- Define commands / queries / handlers following the interface patterns provided by the library.
- Combine with FluentValidation for request validation and MediatR for dispatching commands/queries to handlers.
- Document new abstraction interfaces clearly and keep them lightweight β this library is meant to define contracts, not heavy logic.
π€ Contributing
Contributions are welcome! If you would like to propose improvements, bug-fixes or new abstractions:
- Fork the repository.
- Create a branch for your change (e.g., feature/my-new-abstraction).
- Ensure your changes include tests if applicable.
- Submit a pull request and describe the purpose/impact of your change.
π§Ύ License
This project is licensed under the MIT License.
You are free to use, modify, and distribute it, provided you credit the original author.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. 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. |
-
net10.0
- Azure.Identity (>= 1.17.1)
- BAYSOFT.Abstractions.Tools (>= 10.0.3)
- FluentValidation (>= 12.1.1)
- MediatR (>= 14.0.0)
- Microsoft.EntityFrameworkCore (>= 10.0.3)
- Microsoft.EntityFrameworkCore.Relational (>= 10.0.3)
- Microsoft.Extensions.Localization (>= 10.0.3)
- Microsoft.Extensions.Localization.Abstractions (>= 10.0.3)
- ModelWrapper (>= 10.0.3)
- N.EntityFrameworkCore.Extensions (>= 8.0.0.13)
- System.IdentityModel.Tokens.Jwt (>= 8.16.0)
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 |
|---|---|---|
| 10.0.3 | 89 | 2/17/2026 |
| 10.0.2 | 94 | 2/3/2026 |
| 10.0.1.2 | 99 | 1/24/2026 |
| 10.0.1.1 | 100 | 1/13/2026 |
| 10.0.1 | 93 | 1/12/2026 |
| 9.0.10.1 | 380 | 11/30/2025 |
| 9.0.10 | 214 | 10/27/2025 |
| 8.0.6.22 | 216 | 10/2/2025 |
| 8.0.6.21 | 204 | 10/2/2025 |
| 8.0.6.20 | 199 | 10/2/2025 |
| 8.0.6.19 | 206 | 10/2/2025 |
| 8.0.6.18 | 201 | 10/1/2025 |
| 8.0.6.17 | 226 | 3/1/2025 |
| 8.0.6.16 | 184 | 2/15/2025 |
| 8.0.6.15 | 311 | 10/30/2024 |
| 8.0.6.14 | 190 | 10/7/2024 |
| 8.0.6.13 | 180 | 10/7/2024 |
| 8.0.6.12 | 198 | 7/13/2024 |
| 8.0.6.11 | 192 | 7/11/2024 |
| 8.0.6.10 | 235 | 6/28/2024 |