Franz.Common.Serialization 1.2.63

There is a newer version of this package available.
See the version list below for details.
dotnet add package Franz.Common.Serialization --version 1.2.63                
NuGet\Install-Package Franz.Common.Serialization -Version 1.2.63                
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.Serialization" Version="1.2.63" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Franz.Common.Serialization --version 1.2.63                
#r "nuget: Franz.Common.Serialization, 1.2.63"                
#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.Serialization as a Cake Addin
#addin nuget:?package=Franz.Common.Serialization&version=1.2.63

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

Franz.Common.Serialization

A serialization utility library within the Franz Framework that simplifies JSON and byte array serialization. This package includes custom JSON converters, serializers, and extensions for seamless integration into .NET applications.


Features

  • Custom JSON Converters:
    • DateTimeJsonConverter and DateTimeOffsetJsonConverter for handling specific datetime formats.
    • EnumerationJsonConverter for serializing and deserializing enumerations.
  • Byte Array Serialization:
    • ByteArraySerializer and IByteArraySerializer for efficient byte array serialization and deserialization.
  • JSON Serialization:
    • JsonSerializer and JsonCreationConverter for custom JSON serialization logic.
  • Service Registration:
    • ServiceCollectionExtensions to streamline serializer setup and dependency injection.

Version Information

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

Dependencies

This package is lightweight and has no external dependencies beyond the .NET runtime.


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.Serialization --Version 1.2.63

Usage

1. Register Serialization Services

Use ServiceCollectionExtensions to register the serializers:

using Franz.Common.Serialization.Extensions;

public class Startup
{
    public void ConfigureServices(IServiceCollection services)
    {
        services.AddSerialization();
    }
}

2. Serialize and Deserialize JSON

Leverage JsonSerializer for JSON operations:

using Franz.Common.Serialization;

var jsonSerializer = new JsonSerializer();
var jsonData = jsonSerializer.Serialize(new { Name = "John", Age = 30 });
var person = jsonSerializer.Deserialize<Person>(jsonData);

3. Use Custom JSON Converters

Register and use custom converters like DateTimeJsonConverter:

var options = new JsonSerializerOptions();
options.Converters.Add(new DateTimeJsonConverter());

var json = JsonSerializer.Serialize(DateTime.Now, options);
var dateTime = JsonSerializer.Deserialize<DateTime>(json, options);

4. Byte Array Serialization

Utilize ByteArraySerializer for byte array operations:

using Franz.Common.Serialization;

var byteArraySerializer = new ByteArraySerializer();
var data = new byte[] { 1, 2, 3, 4 };
var serialized = byteArraySerializer.Serialize(data);
var deserialized = byteArraySerializer.Deserialize<byte[]>(serialized);

Integration with Franz Framework

The Franz.Common.Serialization package integrates seamlessly with the Franz Framework, providing utilities for efficient serialization and deserialization in distributed systems. Combine it with other Franz packages for enhanced functionality.


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.63

  • Added DateTimeJsonConverter, DateTimeOffsetJsonConverter, and EnumerationJsonConverter.
  • Introduced ByteArraySerializer and IByteArraySerializer.
  • Enhanced JSON serialization with JsonSerializer and JsonCreationConverter.
  • Provided ServiceCollectionExtensions for streamlined DI setup.

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 (3)

Showing the top 3 NuGet packages that depend on Franz.Common.Serialization:

Package Downloads
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

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.64 8 1/29/2025
1.2.63 93 1/27/2025
1.2.62 65 1/8/2025