DomainCore 1.14.0
dotnet add package DomainCore --version 1.14.0
NuGet\Install-Package DomainCore -Version 1.14.0
<PackageReference Include="DomainCore" Version="1.14.0" />
<PackageVersion Include="DomainCore" Version="1.14.0" />
<PackageReference Include="DomainCore" />
paket add DomainCore --version 1.14.0
#r "nuget: DomainCore, 1.14.0"
#:package DomainCore@1.14.0
#addin nuget:?package=DomainCore&version=1.14.0
#tool nuget:?package=DomainCore&version=1.14.0
DomainCore
Domain primitives, base entities, aggregate roots, and domain events for building Domain-Driven Design applications with .NET.
📦 Installation
dotnet add package DomainCore
🚀 Features
- Base Entities:
BaseEntitywithId,ExternalId, and audit fields - Tenant Entities:
BaseTenantEntityfor multi-tenant applications - Aggregate Roots:
IAggregateRootmarker interface - Domain Events:
DomainEventBaseandHasDomainEventsBasefor event-driven design - Value Objects: Base classes for implementing value objects
- Audit Fields: Built-in
CreatedAt,CreatedBy,UpdatedAt,UpdatedBytracking
📖 Usage
Basic Entity
using DomainCore.Entities;
public class Product : BaseEntity
{
public string Name { get; set; }
public decimal Price { get; set; }
public Product(string name, decimal price, Guid userId)
{
Name = name;
Price = price;
SetUser(userId);
}
}
Multi-Tenant Entity
using DomainCore.Entities;
public class Order : BaseTenantEntity
{
public Guid ProductId { get; set; }
public int Quantity { get; set; }
public decimal TotalPrice { get; set; }
public Order(Guid productId, int quantity, decimal totalPrice, Guid tenantId, Guid userId)
{
ProductId = productId;
Quantity = quantity;
TotalPrice = totalPrice;
SetTenant(tenantId);
SetUser(userId);
}
}
Domain Events
using DomainCore.Events;
public class OrderPlacedEvent : DomainEventBase
{
public Guid OrderId { get; }
public decimal TotalAmount { get; }
public OrderPlacedEvent(Guid orderId, decimal totalAmount)
{
OrderId = orderId;
TotalAmount = totalAmount;
}
}
public class Order : BaseTenantEntity
{
public void Place()
{
// Business logic...
IsPlaced = true;
UpdateTimestamp();
// Raise domain event
RegisterDomainEvent(new OrderPlacedEvent(ExternalId, TotalPrice));
}
}
🏗️ Base Classes
BaseEntity
Provides common entity properties:
Guid Id- Internal database IDGuid ExternalId- Public-facing UUIDDateTime CreatedAt- Creation timestampGuid? CreatedBy- User who created the entityDateTime? UpdatedAt- Last update timestampGuid? UpdatedBy- User who last updated the entity
BaseTenantEntity
Extends BaseEntity with multi-tenancy:
Guid TenantId- Tenant identifier for data isolationvoid SetTenant(Guid tenantId)- Set the tenant ID
HasDomainEventsBase
For entities that raise domain events:
List<DomainEventBase> DomainEvents- Collection of eventsvoid RegisterDomainEvent(DomainEventBase domainEvent)- Add eventvoid ClearDomainEvents()- Clear all events
🤝 Contributing
Contributions are welcome! Please open an issue or submit a pull request.
📝 License
This project is licensed under the MIT License - see the LICENSE file for details.
🔗 Related Packages
- Security.Claims - Security claims and roles
- MultiTenancy.EntityFrameworkCore - Multi-tenant EF Core support
- Identity.Abstractions - Authentication abstractions
💬 Support
- 🐛 Issues: GitHub Issues
- 💬 Discussions: GitHub Discussions
How to Publish
cd C:\desktopContents\projects\SaaS\NuGetPackages\DomainCore
.\publish.ps1 -ApiKey XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX -Bump patch # Bug fixes
.\publish.ps1 -ApiKey XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX -Bump minor # New features
.\publish.ps1 -ApiKey XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX -Bump major # Breaking changes
| 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
- No dependencies.
NuGet packages (1)
Showing the top 1 NuGet packages that depend on DomainCore:
| Package | Downloads |
|---|---|
|
MultiTenancy.EntityFrameworkCore
Multi-tenant data isolation for Entity Framework Core. Provides tenant context services, base tenant entity, and query filtering for SaaS applications. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.14.0 | 0 | 1/11/2026 |
| 1.13.2 | 43 | 1/3/2026 |
| 1.13.1 | 41 | 1/3/2026 |
| 1.13.0 | 47 | 1/3/2026 |
| 1.12.0 | 41 | 1/3/2026 |
| 1.11.0 | 38 | 1/3/2026 |
| 1.10.0 | 44 | 1/2/2026 |
| 1.9.0 | 48 | 1/2/2026 |
| 1.8.0 | 38 | 1/2/2026 |
| 1.7.0 | 38 | 1/2/2026 |
| 1.6.0 | 35 | 1/2/2026 |
| 1.5.0 | 39 | 1/2/2026 |
| 1.4.0 | 39 | 1/2/2026 |
| 1.3.0 | 42 | 1/2/2026 |
| 1.0.1 | 242 | 12/28/2025 |