FQ.Functions 1.0.0-alpha.9

This is a prerelease version of FQ.Functions.
The owner has unlisted this package. This could mean that the package is deprecated, has security vulnerabilities or shouldn't be used anymore.
dotnet add package FQ.Functions --version 1.0.0-alpha.9
                    
NuGet\Install-Package FQ.Functions -Version 1.0.0-alpha.9
                    
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="FQ.Functions" Version="1.0.0-alpha.9" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="FQ.Functions" Version="1.0.0-alpha.9" />
                    
Directory.Packages.props
<PackageReference Include="FQ.Functions" />
                    
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 FQ.Functions --version 1.0.0-alpha.9
                    
#r "nuget: FQ.Functions, 1.0.0-alpha.9"
                    
#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 FQ.Functions@1.0.0-alpha.9
                    
#: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=FQ.Functions&version=1.0.0-alpha.9&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=FQ.Functions&version=1.0.0-alpha.9&prerelease
                    
Install as a Cake Tool

Futeq Core Packages

A modern, minimal, and production-ready foundation for building .NET 9 services and APIs —
designed around Clean Architecture, CQRS, and unified result handling.

This ecosystem includes:

Package Purpose
FQ.Results Uniform success/error result handling, HTTP mapping, and problem-details integration
FQ.Cqrs MediatR pipeline behaviors for CQRS (validation, authorization, idempotency, logging, performance)
FQ.AspNetCore ASP.NET Core utilities (correlation, idempotency, versioning, result mapping)
FQ.Functions Azure Functions utilities (correlation, idempotency, exception handling, result writers)
FQ.Mapping Tiny abstraction over object mapping with first‑class Result<T> support

All libraries target .NET 9 and work with:

  • MediatR 13.1+
  • Microsoft.Azure.Functions.Worker 2.2+
  • ASP.NET Core 9.0+

📦 Installation

dotnet add package FQ.Results
dotnet add package FQ.Cqrs
dotnet add package FQ.AspNetCore
dotnet add package FQ.Functions
dotnet add package FQ.Mapping

🧩 FQ.Results

Provides lightweight primitives for handling outcomes and errors across your entire stack.

Result basics

using FQ.Results;

var ok = Result.Ok();
var user = Result<User>.Ok(new User("alice"));
var notFound = Result.Fail(Error.NotFound("user_not_found", "User does not exist"));

Error factory helpers

var e1 = Error.Validation("email", "Invalid format");
var e2 = Error.Forbidden("no_access", "User has no permission");
var e3 = Error.Conflict("duplicate", "Email already exists");

Mapping to HTTP Problem Details

var shape = e1.ToProblemShape("/api/users/1");

Console.WriteLine(shape.Status);  // 400
Console.WriteLine(shape.Type);    // urn:problem-type:validation

JSON-friendly model

All result and error types are fully serializable with System.Text.Json.

var json = JsonSerializer.Serialize(Result.Fail(Error.NotFound("x", "missing")));

Due to immutability of the record classes, use FQ.Results.JsonResultSerializer for deserialization purposes.

var result = JsonResultSerializer.Deserialize<ResultType>(json, _serializerOptions);

⚙️ FQ.Cqrs

Integrates clean CQRS patterns using MediatR pipeline behaviors and Result semantics.

CQRS Setup

In your Startup or DI registration:

services.AddCqrsUtilities()

Handlers

public sealed record CreateUser(string Email, string Password) : ICommand<Result<Guid>>;

public sealed class CreateUserHandler : IRequestHandler<CreateUser, Result<Guid>>
{
    public async Task<Result<Guid>> Handle(CreateUser cmd, CancellationToken ct)
    {
        if (string.IsNullOrWhiteSpace(cmd.Email))
            return Result<Guid>.Fail(Error.Validation("email", "Email is required"));

        var id = Guid.NewGuid();
        return Result<Guid>.Ok(id);
    }
}

Authorizers

public sealed class CreateUserAuthorizer : IAuthorizer<CreateUser>
{
    public Task<Result> AuthorizeAsync(CreateUser request, CancellationToken ct)
    {
        if (request.Email.EndsWith("@futeq.com"))
            return Task.FromResult(Result.Ok());

        return Task.FromResult(Result.Fail(Error.Forbidden("domain_not_allowed")));
    }
}

Idempotent requests

public sealed record CreateOrder(Guid Id, string Customer)
    : ICommand<Result<Guid>>, IIdempotentRequest
{
    public TimeSpan IdempotencyTtl => TimeSpan.FromMinutes(5);
}

🌐 FQ.AspNetCore

Utilities for ASP.NET Core 9.0 projects — standardized middleware and extensions.

Register services

builder.Services.AddAspNetCoreUtilities();
app.UseAspNetCoreUtilities();

Controller helpers

[HttpPost("users")]
public IActionResult Create([FromBody] CreateUser command)
{
    var result = _mediator.Send(command).Result;
    return result.ToActionResult(this);
}

☁️ FQ.Functions

Azure Functions isolated worker helpers.

Configure

var host = new HostBuilder()
    .ConfigureFunctionsWorkerDefaults(builder =>
    {
        builder.UseFunctionsUtilities();
    })
    .ConfigureServices(services =>
    {
        services.AddFunctionsUtilities();
    })
    .Build();

host.Run();

Usage

public class UsersFunctions
{
    [Function("GetUser")]
    public async Task<HttpResponseData> GetUser(
        [HttpTrigger(AuthorizationLevel.Function, "get", Route = "users/{id}")] HttpRequestData req, string id)
    {
        if (id == "404")
        {
                return await req.WriteResultAsync(Result.Fail(Error.NotFound("user", "Not found")));
        }

        return await req.WriteResultAsync(Result.Ok());
    }
}

✅ Testing

All packages have tests (xUnit + FluentAssertions + NSubstitute).

dotnet test -c Release

🧩 License

MIT © 2025 Futeq

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

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