Relatude.DB.Ecom 1.0.20

There is a newer version of this package available.
See the version list below for details.
dotnet add package Relatude.DB.Ecom --version 1.0.20
                    
NuGet\Install-Package Relatude.DB.Ecom -Version 1.0.20
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Relatude.DB.Ecom" Version="1.0.20" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Relatude.DB.Ecom" Version="1.0.20" />
                    
Directory.Packages.props
<PackageReference Include="Relatude.DB.Ecom" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Relatude.DB.Ecom --version 1.0.20
                    
#r "nuget: Relatude.DB.Ecom, 1.0.20"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Relatude.DB.Ecom@1.0.20
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Relatude.DB.Ecom&version=1.0.20
                    
Install as a Cake Addin
#tool nuget:?package=Relatude.DB.Ecom&version=1.0.20
                    
Install as a Cake Tool

Relatude.Ecom

A .NET 8 e-commerce backend layered on Relatude.CMS (package dependency), which in turn runs on the Relatude.DB node/graph database. Adds the commerce model (products, orders, carts), pricing, and pluggable providers (payment, shipping, tax, …).

Using an AI coding agent? This package ships a Claude Code skill (relatude-ecom) with the same guidance below. Read the Relatude.CMS docs (relatude-cms skill) first — it covers the shared Relatude.DB fundamentals (host setup, NodeStore, modeling interfaces, relations, CRUD, queries) that this layer assumes. Relatude.CMS is pulled in transitively, so its docs travel alongside this package.

Commerce model

Entities are interfaces, like in CMS. Products extend the CMS content model so they are routable pages:

public interface IProduct : IItem, IPage {
    decimal Price { get; set; }
    int NumberInStock { get; set; }
    ProductCategoryProducts.Category Category { get; set; }   // one-end → category
    ProductVariants.SubVariants Variants { get; set; }         // many-end → variant products
    [EmbeddedMapProperty(KeyProperty = nameof(IAlternativeCurrencyPrice.CurrencyCode))]
    EmbeddedMap<string, IAlternativeCurrencyPrice> AlternativePrices { get; }
}

Core entities: IShop, IProduct, IProductCategory, IProductBundle, ISimpleVariant, IBrand, IOrder, IOrderItem, IEcomUser, ICurrency, IEcomCountry, IPaymentMethod, IShippingMethod, ITaxClass, ITaxRate, ISalesChannel, IDiscount. Relations live in Models/EcomRelations.cs, declared with the same OneToMany/ManyToMany marker-class pattern as CMS.

Carts (ShoppingCartService)

A cart is an IOrder with OrderStatus.Basket — there is no separate cart type; checkout advances the order's status. ShoppingCartService resolves the cart from IEcomUser.Orders for authenticated users (looked up via the ClaimTypes.NameIdentifier claim) or from a cookie (EcomSettings.CartCookieName, default ecom.cart) holding the order Guid for anonymous users. Every method takes NodeStore db. Items are managed via SetRelation/ClearRelation on IOrder.OrderItems; re-adding a product increments Quantity instead of duplicating. Settings come from IOptions<EcomSettings> (config section "Ecom").

Pricing (DefaultPricingService)

DefaultPricingService : IPricingService composes four injected collaborators — IPriceResolver (base price), IProductDiscountProvider, IOrderDiscountProvider, and ITaxCalculationProvider (VAT). A PricingContext flows through every calculation; it requires Shop and CurrencyCode and carries the NodeStore. Amounts are computed ex-VAT first, then VAT applied, rounded via CurrencyUtils.Round. CalculateProductVariantPrices prices the product plus its Variants. (CalculateOrderPrice is currently not implemented.)

Providers (Providers/...)

Each pluggable concern is an IXxxProvider interface with a Default* implementation: Currency, Discounts, Inventory, Notification, Payment, Shipping, Tax. Multi-implementation concerns (Payment, Shipping) resolve a concrete provider by a string ProviderKey via a factory over IEnumerable<IXxxProvider>:

services.AddScoped<IPaymentProvider, StripePaymentProvider>();   // each exposes ProviderKey
services.AddScoped<IPaymentProvider, NetsPaymentProvider>();
services.AddScoped<IPaymentProviderFactory, PaymentProviderFactory>();
// at runtime:
var provider = factory.GetProvider(paymentMethod.ProviderKey);   // throws on unknown key

The order/payment-method node stores which ProviderKey to use. This library supplies the contracts and Default* implementations; the host registers concrete third-party providers and wires the rest in DI.

Notes

  • A cart is just an IOrder in Basket status — there is no dedicated cart entity.
  • CalculateOrderPrice is not implemented yet.
  • PricingContext without Shop/CurrencyCode throws — always set both.
  • All Relatude.DB rules from Relatude.CMS apply (Create doesn't persist, relation ends aren't lists, mutate-then-Update, …).
  • Relatude.DB source/API reference: https://github.com/Relatude/Relatude.DB
Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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
1.0.21 97 6/26/2026
1.0.20 104 6/26/2026