![]() |
VOOZH | about |
dotnet add package E13.Common.Domain --version 2025.117.22
NuGet\Install-Package E13.Common.Domain -Version 2025.117.22
<PackageReference Include="E13.Common.Domain" Version="2025.117.22" />
<PackageVersion Include="E13.Common.Domain" Version="2025.117.22" />Directory.Packages.props
<PackageReference Include="E13.Common.Domain" />Project file
paket add E13.Common.Domain --version 2025.117.22
#r "nuget: E13.Common.Domain, 2025.117.22"
#:package E13.Common.Domain@2025.117.22
#addin nuget:?package=E13.Common.Domain&version=2025.117.22Install as a Cake Addin
#tool nuget:?package=E13.Common.Domain&version=2025.117.22Install as a Cake Tool
👁 NuGet Version
👁 License: MIT
E13.Common.Domain is a package within the E13.Common collection that provides core domain abstractions and patterns for building domain-driven applications. It defines interfaces and base classes for domain entities and implements the specification pattern for encapsulating business rules.
dotnet add package E13.Common.Domain
using E13.Common.Domain;
// Basic entity
public class Product : IEntity
{
public Guid Id { get; set; }
public string Name { get; set; }
public decimal Price { get; set; }
}
// Entity with tracking information
public class Customer : IEntity, ICreatable, IModifiable, IDeletable
{
public Guid Id { get; set; }
public string Name { get; set; }
// ICreatable implementation
public string? CreatedBy { get; set; }
public string? CreatedSource { get; set; }
public DateTime? Created { get; set; }
// IModifiable implementation
public string? ModifiedBy { get; set; }
public string? ModifiedSource { get; set; }
public DateTime? Modified { get; set; }
// IDeletable implementation
public string? DeletedBy { get; set; }
public string? DeletedSource { get; set; }
public DateTime? Deleted { get; set; }
// IDeletable provides this method automatically
// public bool IsDeleted() => Deleted != null;
}
using E13.Common.Domain.Specifications;
// Create a specification for active customers
public class ActiveCustomerSpecification : Specification<Customer>
{
public override Expression<Func<Customer?, bool>> ToExpression()
{
return customer => customer != null && customer.Deleted == null;
}
}
// Create a specification for premium customers
public class PremiumCustomerSpecification : Specification<Customer>
{
public override Expression<Func<Customer?, bool>> ToExpression()
{
return customer => customer != null && customer.IsPremium;
}
}
// Using specifications
var activeSpec = new ActiveCustomerSpecification();
var premiumSpec = new PremiumCustomerSpecification();
// Combine specifications
var activePremiumSpec = activeSpec.BitwiseAnd(premiumSpec);
// Check if a customer satisfies the specification
bool isPremiumActive = activePremiumSpec.IsSatisfiedBy(customer);
// Use with LINQ
var activePremiumCustomers = dbContext.Customers
.Where(activePremiumSpec.ToExpression())
.ToList();
E13.Common.Domain is part of the E13.Common collection, which includes:
Contributions to E13.Common.Domain are welcome. If you have suggestions or improvements, please submit an issue or create a pull request in the GitHub repository.
This project is licensed under the MIT License. For more details, see the LICENSE file in the repository.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net9.0 net9.0 is compatible. net9.0-android net9.0-android was computed. net9.0-browser net9.0-browser was computed. net9.0-ios net9.0-ios was computed. net9.0-maccatalyst net9.0-maccatalyst was computed. net9.0-macos net9.0-macos was computed. net9.0-tvos net9.0-tvos was computed. net9.0-windows net9.0-windows was computed. net10.0 net10.0 was computed. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
Showing the top 1 NuGet packages that depend on E13.Common.Domain:
| Package | Downloads |
|---|---|
|
E13.Common.Data.Db
Common package for defining a Data layer against an EFCore accessible backend |
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 2025.117.22 | 214 | 4/27/2025 |
| 2025.114.21 | 262 | 4/24/2025 |
| 2025.114.20 | 263 | 4/24/2025 |
| 2025.114.19 | 283 | 4/24/2025 |
| 2025.114.18 | 258 | 4/24/2025 |
| 2025.112.17 | 299 | 4/22/2025 |
| 2025.112.16 | 275 | 4/22/2025 |
| 2025.111.15 | 305 | 4/21/2025 |
| 2025.106.14 | 328 | 4/16/2025 |
| 2025.106.12 | 343 | 4/16/2025 |
| 2025.97.11 | 286 | 4/7/2025 |
| 2025.97.10 | 303 | 4/7/2025 |
| 2025.96.9 | 236 | 4/6/2025 |
| 2025.96.8 | 254 | 4/6/2025 |
| 2025.91.7 | 265 | 4/1/2025 |
| 2025.91.6 | 287 | 4/1/2025 |
| 2025.90.4 | 304 | 3/31/2025 |
| 2023.30.1 | 518 | 1/30/2023 |
| 2023.18.1 | 493 | 1/18/2023 |
| 1.0.0 | 233 | 4/1/2025 |