AppXDev.SyncEntityFramework.Domain 0.5.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package AppXDev.SyncEntityFramework.Domain --version 0.5.0
                    
NuGet\Install-Package AppXDev.SyncEntityFramework.Domain -Version 0.5.0
                    
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="AppXDev.SyncEntityFramework.Domain" Version="0.5.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="AppXDev.SyncEntityFramework.Domain" Version="0.5.0" />
                    
Directory.Packages.props
<PackageReference Include="AppXDev.SyncEntityFramework.Domain" />
                    
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 AppXDev.SyncEntityFramework.Domain --version 0.5.0
                    
#r "nuget: AppXDev.SyncEntityFramework.Domain, 0.5.0"
                    
#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 AppXDev.SyncEntityFramework.Domain@0.5.0
                    
#: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=AppXDev.SyncEntityFramework.Domain&version=0.5.0
                    
Install as a Cake Addin
#tool nuget:?package=AppXDev.SyncEntityFramework.Domain&version=0.5.0
                    
Install as a Cake Tool

AppXDev.SyncEntityFramework

NuGet License

A bidirectional Entity Framework sync framework for distributed retail systems. Synchronize data between a central server and multiple store locations using SQL Server and message-based communication.

Features

  • 🔄 Bidirectional Sync - Push and pull changes between central and store databases
  • Conflict Resolution - Configurable strategies (LastWriteWins, Merge, Manual)
  • 📦 Entity Framework Core - Built on EF Core 9.0 with change tracking
  • 🐰 RabbitMQ Integration - Message-based real-time sync notifications
  • 🏪 Multi-Store Support - Scale to 100+ store locations
  • 📝 Offline Support - Queue changes locally when disconnected (roadmap)

Installation

# Full SDK (includes Domain, Application, and Infrastructure)
dotnet add package AppXDev.SyncEntityFramework

# Or install individual packages
dotnet add package AppXDev.SyncEntityFramework.Domain
dotnet add package AppXDev.SyncEntityFramework.Application

Demos

This repository includes two demo applications to showcase the SDK capabilities:

1. Simple Console Demo

A basic example demonstrating how to set up the SDK, define a Sync Entity, and record changes.

dotnet run --project src/AppXDev.Sync.Demo.Console/AppXDev.Sync.Demo.Console.csproj

2. Multi-Store Simulation

A complex simulation of a 3-node topology (Central, Store A, Store B) demonstrating data propagation and conflict resolution.

dotnet run --project src/AppXDev.Sync.Demo.Simulation/AppXDev.Sync.Demo.Simulation.csproj

Quick Start

1. Define Syncable Entities

using AppXDev.Sync.Domain.Entities;

public class Product : SyncEntity
{
    public string Name { get; set; } = string.Empty;
    public decimal Price { get; set; }
    public int CategoryId { get; set; }
}

2. Configure Service Registration (DI)

In your Program.cs, register the necessary services:

using AppXDev.Sync.Domain.Interfaces;
using AppXDev.Sync.Application.Services;
using AppXDev.Sync.Infrastructure.Persistence;
using AppXDev.Sync.Infrastructure.Messaging;

// 1. Database
builder.Services.AddDbContext<SyncDbContext>(options =>
    options.UseSqlServer("YourConnectionString"));

// 2. Messaging (RabbitMQ)
builder.Services.AddSingleton<IMessageBroker, RabbitMqBroker>();

// 3. Sync Core Services
builder.Services.AddScoped<IChangeTracker, EfCoreChangeTracker>();
builder.Services.AddScoped<IConflictResolver, ConflictResolverService>();
builder.Services.AddScoped<ISyncEngine, SyncService>();

// 4. Manual Conflict Repository (Offline Mode)
builder.Services.AddScoped<ISyncConflictRepository, EfCoreSyncConflictRepository>();

3. Create a Store DbContext

3. Use Sync Service

using AppXDev.Sync.Application.Services;

// Pull changes from central
var pullResult = await syncService.PullAsync(new SyncContext(
    StoreId: "STORE-001",
    LastSyncTimestamp: lastSync
));

// Push local changes to central
var pushResult = await syncService.PushAsync(new SyncContext(
    StoreId: "STORE-001",
    LastSyncTimestamp: null
));

Packages

Package Description
AppXDev.SyncEntityFramework Full SDK with all dependencies
AppXDev.SyncEntityFramework.Domain Core entities and interfaces
AppXDev.SyncEntityFramework.Application Business logic and sync services

Requirements

  • .NET 9.0 or later
  • SQL Server (or compatible EF Core provider)
  • RabbitMQ (optional, for real-time sync)

Documentation

License

This project is licensed under the MIT License - see the LICENSE file for details.

Contributing

Contributions are welcome! Please read our contributing guidelines before submitting pull requests.

Product Compatible and additional computed target framework versions.
.NET net9.0 is compatible.  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.
  • net9.0

    • No dependencies.

NuGet packages (3)

Showing the top 3 NuGet packages that depend on AppXDev.SyncEntityFramework.Domain:

Package Downloads
AppXDev.SyncEntityFramework.Application

Bidirectional Entity Framework sync framework for distributed retail systems

AppXDev.SyncEntityFramework.Infrastructure

Bidirectional Entity Framework sync framework for distributed retail systems

AppXDev.SyncEntityFramework

Metapackage for AppXDev.SyncEntityFramework - Includes Domain, Application, and Infrastructure.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.6.1 131 1/4/2026
0.5.0 139 1/3/2026
0.4.2 138 1/3/2026