Skip to content

PampaLabs/EntityStitching

Repository files navigation

EntityStitching

CI Downloads NuGet

EntityStitching enables defining aggregate boundaries by specifying which entities belong together, independent of how data is loaded, joined, or materialized.

Getting Started

EntityStitching is framework-agnostic by design, with integrations delivered through separate packages.

Installation

Install the core package from NuGet:

dotnet add package EntityStitching

If you are using EntityFramework, also install the integration package:

dotnet add package EntityStitching.EntityFrameworkCore

Usage

EntityStitching revolves around aggregate boundaries, which represent a set of property paths associated with an aggregate root.

You start from an empty aggregate boundary and progressively include properties using a fluent, strongly-typed API:

var boundary = new AggregateBoundary<Order>()
    .Include(o => o.Customer)
        .ThenInclude(c => c.Address)
    .Include(o => o.Items);

The resulting aggregate boundary is expressed as a structured collection of property paths that define how the aggregate root is composed with related entities.

Entity Framework

When using EntityFramework, the aggregate boundary can be applied directly to an existing IQueryable<TEntity>:

var query = dbContext.Orders.Include(boundary);

The integration translates the property paths defined in the aggregate boundary into the corresponding EntityFramework includes.

Contributing

Contributions are welcome! Please open an issue or submit a pull request on GitHub.

About

Aggregate boundaries for .NET

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages