ArkaSoftware.Extensions.Serializers.Abstractions 2.0.0

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

ArkaSoftware.Extensions.Serializers.Abstractions

ArkaSoftware.Extensions.Serializers.Abstractions provides clean and pluggable interfaces for handling both JSON and Excel serialization in .NET applications. These abstractions allow you to decouple your code from specific serialization libraries and make your architecture more modular and testable.


๐Ÿ”ง Interfaces

IJsonSerializer

A minimal interface to abstract JSON serialization and deserialization.

public interface IJsonSerializer
{
    string Serialize<TInput>(TInput input);
    TOutput Deserialize<TOutput>(string input);
    object Deserialize(string input, Type type);
}

โœ… This allows you to plug in any JSON library such as:

  • System.Text.Json

  • Newtonsoft.Json

  • Utf8Json

  • or even your custom serializer.


IExcelSerializer

An interface for converting objects to and from Excel format.

public interface IExcelSerializer
{
    byte[] ListToExcelByteArray<T>(List<T> list, string sheetName = "Result");
    DataTable ExcelToDataTable(byte[] bytes);
    List<T> ExcelToList<T>(byte[] bytes);
}

โœ… Useful in scenarios where:

  • You want to export reports or data tables to Excel

  • You need to read and process uploaded Excel files

  • You want to convert Excel to strongly typed objects


๐ŸŽฏ Why Use This?

  • Decouples business logic from infrastructure

  • Makes it easier to switch between libraries (e.g., Newtonsoft.Json โ†” System.Text.Json)

  • Enables mocking and testing of serialization logic

  • Enhances maintainability and consistency in large systems


๐Ÿงช Example: Testable Implementation

public class NewtonsoftJsonSerializer : IJsonSerializer
{
    public string Serialize<TInput>(TInput input) =>
        JsonConvert.SerializeObject(input);

    public TOutput Deserialize<TOutput>(string input) =>
        JsonConvert.DeserializeObject<TOutput>(input)!;

    public object Deserialize(string input, Type type) =>
        JsonConvert.DeserializeObject(input, type)!;
}


โœ… Use Cases

  • API serialization in Web APIs

  • Excel file exports and imports in admin dashboards

  • Integration with external systems that rely on Excel/JSON formats


๐Ÿข Maintained by

ArkaSoftware
๐Ÿ“ง Email Us
๐ŸŒ Web Site Visit

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

    • No dependencies.

NuGet packages (6)

Showing the top 5 NuGet packages that depend on ArkaSoftware.Extensions.Serializers.Abstractions:

Package Downloads
ArkaSoftware.Extensions.Caching.Distributed.InMemory

Implimentaion Caching InMemory In Asp.net Core

Arks.Framework.Infra.Data.MSSQL.Command

Infrastructure library for MSSQL command handling using Entity Framework Core. Provides base classes, extensions, interceptors, and value converters for efficient database interactions.

ArkaSoftware.Extensions.Serializers.Microsoft

Serialize And Deserialize JSON And Any Template In Asp.Net Core Usage With Microsoft Infrastructure.

Arks.Framework.Endpoints.Web

A library for building robust and standardized web endpoints in .NET applications. Includes base controllers, middleware, filters, and extensions for simplifying API development.

Arks.Framework.Utilities.OutService

A multi-purpose library for .NET developers, including utilities for working with Persian dates, strings, and unique ID generation.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
2.0.0 290 4/16/2025
1.0.0 446 4/16/2024