AppXDev.SyncEntityFramework.Infrastructure
0.4.2
See the version list below for details.
dotnet add package AppXDev.SyncEntityFramework.Infrastructure --version 0.4.2
NuGet\Install-Package AppXDev.SyncEntityFramework.Infrastructure -Version 0.4.2
<PackageReference Include="AppXDev.SyncEntityFramework.Infrastructure" Version="0.4.2" />
<PackageVersion Include="AppXDev.SyncEntityFramework.Infrastructure" Version="0.4.2" />
<PackageReference Include="AppXDev.SyncEntityFramework.Infrastructure" />
paket add AppXDev.SyncEntityFramework.Infrastructure --version 0.4.2
#r "nuget: AppXDev.SyncEntityFramework.Infrastructure, 0.4.2"
#:package AppXDev.SyncEntityFramework.Infrastructure@0.4.2
#addin nuget:?package=AppXDev.SyncEntityFramework.Infrastructure&version=0.4.2
#tool nuget:?package=AppXDev.SyncEntityFramework.Infrastructure&version=0.4.2
AppXDev.SyncEntityFramework
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
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 | Versions 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. |
-
net9.0
- AppXDev.SyncEntityFramework.Application (>= 0.4.2)
- AppXDev.SyncEntityFramework.Domain (>= 0.4.2)
- Microsoft.EntityFrameworkCore.SqlServer (>= 9.0.0)
- RabbitMQ.Client (>= 7.0.0)
- Serilog.AspNetCore (>= 8.0.3)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on AppXDev.SyncEntityFramework.Infrastructure:
| Package | Downloads |
|---|---|
|
AppXDev.SyncEntityFramework
Metapackage for AppXDev.SyncEntityFramework - Includes Domain, Application, and Infrastructure. |
GitHub repositories
This package is not used by any popular GitHub repositories.