ArkaSoftware.Extensions.ObjectMappers.Abstractions 2.0.0

dotnet add package ArkaSoftware.Extensions.ObjectMappers.Abstractions --version 2.0.0
                    
NuGet\Install-Package ArkaSoftware.Extensions.ObjectMappers.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.ObjectMappers.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.ObjectMappers.Abstractions" Version="2.0.0" />
                    
Directory.Packages.props
<PackageReference Include="ArkaSoftware.Extensions.ObjectMappers.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.ObjectMappers.Abstractions --version 2.0.0
                    
#r "nuget: ArkaSoftware.Extensions.ObjectMappers.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.ObjectMappers.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.ObjectMappers.Abstractions&version=2.0.0
                    
Install as a Cake Addin
#tool nuget:?package=ArkaSoftware.Extensions.ObjectMappers.Abstractions&version=2.0.0
                    
Install as a Cake Tool

ArkaSoftware.Extensions.ObjectMappers.Abstractions

ArkaSoftware.Extensions.ObjectMappers.Abstractions provides a clean and minimal interface for performing object-to-object mapping in .NET applications. This abstraction helps decouple your application logic from specific mapping libraries like AutoMapper, Mapster, etc.


πŸ”§ Interface

IMapperAdapter

Defines a generic method for mapping between two types:

public interface IMapperAdapter
{
    TDestination Map<TSource, TDestination>(TSource source);
}

🎯 Why Use This?

  • Decouple your app from specific mapping tools (AutoMapper, Mapster, etc.)

  • Enable testability by mocking or faking mapping

  • Increase portability and flexibility in your architecture

  • Ideal for Clean Architecture and DDD


πŸ” Example Implementation

Here’s how you could implement it with AutoMapper:

public class AutoMapperAdapter : IMapperAdapter
{
    private readonly IMapper _mapper;

    public AutoMapperAdapter(IMapper mapper)
    {
        _mapper = mapper;
    }

    public TDestination Map<TSource, TDestination>(TSource source)
    {
        return _mapper.Map<TDestination>(source);
    }
}


πŸ§ͺ Testing Example

In tests, you could create a fake or manual implementation:

public class FakeMapperAdapter : IMapperAdapter
{
    public TDestination Map<TSource, TDestination>(TSource source)
    {
        return Activator.CreateInstance<TDestination>()!;
    }
}


βœ… When to Use

  • When you want to isolate your application logic from infrastructure dependencies

  • When you want to mock mappings in unit/integration tests

  • When you're building a pluggable or framework-based system


🏒 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 (2)

Showing the top 2 NuGet packages that depend on ArkaSoftware.Extensions.ObjectMappers.Abstractions:

Package Downloads
ArkaSoftware.Extensions.ObjectMappers.AutoMapper

Object Mapper Auto In Usage Asp.net Core

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 279 4/16/2025
1.0.1 393 7/5/2024
1.0.0 198 4/16/2024