JamaisVu.Framework 1.0.0-alpha4

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

JamaisVu.Framework

Ensure your operations run never before-only once.
JamaisVu is a small, flexible .NET framework that lets you guard any piece of code—background jobs, message handlers, console tools, domain services—against duplicate execution, with zero pipeline magic or attributes required.


🚀 Key Features

  • Framework-agnostic
    Call a guard anywhere in your code: worker loops, event handlers, CLI tools, domain services—no filters or middleware needed.

  • Pluggable stores
    Swap in-memory, Redis, SQL, or your own implementation by registering IJamaisVuStore variants via DI.

  • Fluent, intent-driven API

  • Result-driven control flow:

    public enum JamaisVuStatus { FirstRun, Repeated, StoreUnavailable }
    public sealed class JamaisVuResult { public JamaisVuStatus Status { get; init; } }
    
    
  • DI-ready One extension wires up flow factories, guards and your store implementations.

⚙️ Installation

dotnet add package JamaisVu.Framework

📦 DI Configuration

using JamaisVu.Extensions;
using Microsoft.Extensions.DependencyInjection;

var builder = Host.CreateDefaultBuilder(args)
    .ConfigureServices(services =>
    {
        services
            .AddJamaisVu()
            .ConfigureStores(stores =>
            {
                stores.AddScoped<InMemoryJamaisVuStore>();
                stores.AddSingleton<RedisJamaisVuStore>();
                // …add your custom stores here
            });

        // …other services
    });

⚡ Quickstart

// inject JamaisVuGuard<YourStore> via DI
await _guard.ExecuteAsync(
    key: $"invoice:{orderId}",
    onFirstRunAsync:    () => ProcessInvoiceAsync(orderId),
    onRepeatedAsync:    () => SkipProcessingAsync(orderId),
    onUnavailableAsync: () => LogWarningAsync(orderId)
);

📚 API Overview

public enum JamaisVuStatus
{
    FirstRun,
    Repeated,
    StoreUnavailable
}

public sealed class JamaisVuResult
{
    public JamaisVuStatus Status { get; init; }
}

public interface IJamaisVuStore
{
    Task<JamaisVuResult> EnsureAsync(string key);
}

public interface IJamaisVuFlow
{
    IJamaisVuFlow For(string key);
    IJamaisVuFlow OnFirstRunAsync(Func<Task> action);
    IJamaisVuFlow OnRepeatedAsync(Func<Task> action);
    IJamaisVuFlow OnUnavailableAsync(Func<Task> action);
    Task EnsureAsync();
}

public class JamaisVuGuard<TStore> where TStore : IJamaisVuStore
{
    public Task ExecuteAsync(
        string key,
        Func<Task> onFirstRunAsync,
        Func<Task>? onRepeatedAsync    = null,
        Func<Task>? onUnavailableAsync = null
    );
}

🔍 Why JamaisVu?

Most libraries tie idempotency to HTTP filters, messaging outboxes, or middleware. JamaisVu gives you a pure “call-where-you-need” guard, so you decide exactly which operations run once, without hidden pipelines or attributes.


📖 License

Released under the MIT License.

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.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on JamaisVu.Framework:

Package Downloads
JamaisVU.Extensions

DI extension methods and builder types (AddJamaisVu()/ConfigureStores(…)) to wire JamaisVu into any .NET host.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.0-alpha4 214 9/23/2025
1.0.0-alpha3 208 9/22/2025
1.0.0-alpha2 182 9/5/2025