Franz.Common.Headers 1.2.62

dotnet add package Franz.Common.Headers --version 1.2.62                
NuGet\Install-Package Franz.Common.Headers -Version 1.2.62                
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="Franz.Common.Headers" Version="1.2.62" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Franz.Common.Headers --version 1.2.62                
#r "nuget: Franz.Common.Headers, 1.2.62"                
#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.
// Install Franz.Common.Headers as a Cake Addin
#addin nuget:?package=Franz.Common.Headers&version=1.2.62

// Install Franz.Common.Headers as a Cake Tool
#tool nuget:?package=Franz.Common.Headers&version=1.2.62                

Here’s the README file tailored for the Franz.Common.Headers package based on its structure and dependencies:


Franz.Common.Headers

A utility library within the Franz Framework designed to simplify and standardize header management in .NET applications. This package integrates with the dependency injection system to ensure consistent handling of headers across services and middleware.


Features

  • Header Management:
    • Tools and utilities for managing HTTP headers in applications.
  • Service Registration:
    • ServiceCollectionExtensions to streamline dependency injection setup for header management.
  • Centralized Configuration:
    • Supports resource-based configurations using Resources.resx.
  • Compatibility:
    • Seamless integration with Franz.Common and Franz.Common.DependencyInjection.

Version Information

  • Current Version: 1.2.62
  • Part of the private Franz Framework ecosystem.

Dependencies

This package relies on:

  • Microsoft.Extensions.Primitives (8.0.0): Utilities for working with string tokens and collections.
  • Franz.Common: Core utilities for the framework.
  • Franz.Common.DependencyInjection: Simplified DI patterns and service extensions.

Installation

From Private Azure Feed

Since this package is hosted privately, configure your NuGet client:

dotnet nuget add source "https://your-private-feed-url" \
  --name "AzurePrivateFeed" \
  --username "YourAzureUsername" \
  --password "YourAzurePassword" \
  --store-password-in-clear-text

Install the package:

dotnet add package Franz.Common.Headers --version 1.2.62

Usage

1. Dependency Injection

Register header-related services using the ServiceCollectionExtensions:

using Franz.Common.Headers.Extensions;

public class Startup
{
    public void ConfigureServices(IServiceCollection services)
    {
        services.AddHeaderManagement(); // Registers header utilities and related services
    }
}

2. Access Headers in Middleware or Services

Use the registered services to access and manage headers consistently:

public class MyHeaderService
{
    private readonly IHttpContextAccessor _httpContextAccessor;

    public MyHeaderService(IHttpContextAccessor httpContextAccessor)
    {
        _httpContextAccessor = httpContextAccessor;
    }

    public string GetHeaderValue(string headerName)
    {
        return _httpContextAccessor.HttpContext?.Request.Headers[headerName].ToString();
    }
}

3. Resource-Based Configurations

Utilize Resources.resx to centralize header key definitions:

var customHeaderKey = Properties.Resources.CustomHeaderKey; // Retrieve header key from resources

Integration with Franz Framework

The Franz.Common.Headers package integrates seamlessly with:

  • Franz.Common: Core utilities for shared functionality.
  • Franz.Common.DependencyInjection: Simplifies the DI setup for header management services.

Ensure these dependencies are installed to fully utilize the library.


Contributing

This package is part of a private framework. Contributions are limited to the internal development team. If you have access, follow these steps:

  1. Clone the repository.
  2. Create a feature branch.
  3. Submit a pull request for review.

License

This library is licensed under the MIT License. See the LICENSE file for more details.


Changelog

Version 1.2.62

  • Added ServiceCollectionExtensions for streamlined header management registration.
  • Integrated Resources.resx for centralized header key management.
  • Full compatibility with Franz.Common and Franz.Common.DependencyInjection.
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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (6)

Showing the top 5 NuGet packages that depend on Franz.Common.Headers:

Package Downloads
Franz.Common.Messaging

Shared utility library for the Franz Framework.

Franz.Common.Messaging.Identity

Shared utility library for the Franz Framework.

Franz.Common.Http.Headers

Shared utility library for the Franz Framework.

Franz.Common.Http.Client

Shared utility library for the Franz Framework.

Franz.Common.Http.MultiTenancy

Shared utility library for the Franz Framework.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.2.62 97 1/8/2025