SyncLib.Abstractions 8.3.2

dotnet add package SyncLib.Abstractions --version 8.3.2
                    
NuGet\Install-Package SyncLib.Abstractions -Version 8.3.2
                    
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="SyncLib.Abstractions" Version="8.3.2" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="SyncLib.Abstractions" Version="8.3.2" />
                    
Directory.Packages.props
<PackageReference Include="SyncLib.Abstractions" />
                    
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 SyncLib.Abstractions --version 8.3.2
                    
#r "nuget: SyncLib.Abstractions, 8.3.2"
                    
#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 SyncLib.Abstractions@8.3.2
                    
#: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=SyncLib.Abstractions&version=8.3.2
                    
Install as a Cake Addin
#tool nuget:?package=SyncLib.Abstractions&version=8.3.2
                    
Install as a Cake Tool

SyncLib

This package has moved. The Dragonfire suite is now developed in a single repository: outboxnet/Dragonfire. Visit it for the latest version and the full suite of packages.

A small, opinionated library for running scheduled data-synchronization jobs in .NET hosted apps. Each provider fetches data from somewhere (HTTP API, queue, file system, …), maps it to your domain entities, and persists it through a repository you control. The library handles scheduling, retries, circuit-breaking, and observability.

Packages

Package Purpose
SyncLib.Abstractions Interfaces only — depend on this from your domain projects.
SyncLib.Core Orchestrator, retry, circuit breaker, metrics, tracing.
SyncLib.EntityFrameworkCore Optional EF Core implementations of ISyncStateStore and a generic repository.

The entity types you sync do not carry sync metadata. Last-sync state (timestamp, status, duration, error, counts) is persisted separately through ISyncStateStore, so your domain model stays clean.

Quick start

services.AddSyncLibrary();

services.AddSyncProvider<WeatherDto, WeatherEntity>("weather")
    .WithConfiguration(new ProviderSyncConfiguration
    {
        ProviderName = "weather",
        SyncInterval = TimeSpan.FromMinutes(5)
    })
    .WithDataProvider<WeatherApiProvider>()
    .WithRepository<WeatherRepository>()
    .WithMapper<WeatherMapper>()
    .Build();

// EF-backed sync state (recommended)
services.AddDbContext<AppDbContext>(o => o.UseSqlServer(connStr));
services.AddEntityFrameworkSyncStateStore<AppDbContext>();

Hosting models

SyncLib has two entry points and you pick whichever matches your host:

Host Register Drives the schedule
ASP.NET / Worker Service services.AddSyncLibrary() A built-in BackgroundService runs each provider on its SyncInterval.
Azure Functions / cron job / on-demand services.AddSyncRunner() You invoke ISyncRunner.RunAllAsync() (or RunAsync(name)) — typically from a [TimerTrigger].

The same fetch → map → repository → state → metrics pipeline runs in both modes. Your WithRepository<TYourRepo>() is what actually persists data, so "the common logic" is shared regardless of who pulls the trigger.

Azure Functions example

// Program.cs
builder.Services.AddSyncRunner();
builder.Services.AddSyncProvider<WeatherDto, WeatherEntity>("weather")
    .WithConfiguration(new ProviderSyncConfiguration { ProviderName = "weather", MaxRetryAttempts = 2 })
    .WithDataProvider<WeatherApiProvider>()
    .WithRepository<MyWeatherRepository>()   // your own implementation
    .WithMapper<WeatherMapper>()
    .Build();

// SyncTimerFunction.cs
[Function("RunAllSyncs")]
public Task Run([TimerTrigger("0 */5 * * * *")] TimerInfo timer, CancellationToken ct)
    => _runner.RunAllAsync(ct);

Full sample under samples/SyncLib.Sample.AzureFunctions.

Observability

  • Sync state per provider — query ISyncStateReader for last run time, status, duration, record count, and last error message.
  • Metricssynclib.sync.duration, synclib.sync.records, synclib.sync.failures, synclib.sync.successes exposed on the SyncLib Meter.
  • TracingSyncLib ActivitySource emits a span per run with sync.provider, sync.records, and sync.status tags.

Sample app under samples/SyncLib.Sample.WebApi exposes a /sync/state endpoint that returns the last-sync record for every provider.

License

MIT

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.
  • net8.0

    • No dependencies.

NuGet packages (2)

Showing the top 2 NuGet packages that depend on SyncLib.Abstractions:

Package Downloads
SyncLib.EntityFrameworkCore

EF Core implementations of SyncLib state store and a generic repository.

SyncLib.Core

Hosted orchestrator, retry, circuit-breaker, metrics and tracing for SyncLib.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
8.3.2 137 5/1/2026
8.0.1 133 4/27/2026
8.0.0 131 4/27/2026