ArkaSoftware.Extensions.ObjectMappers.AutoMapper
2.0.0
dotnet add package ArkaSoftware.Extensions.ObjectMappers.AutoMapper --version 2.0.0
NuGet\Install-Package ArkaSoftware.Extensions.ObjectMappers.AutoMapper -Version 2.0.0
<PackageReference Include="ArkaSoftware.Extensions.ObjectMappers.AutoMapper" Version="2.0.0" />
<PackageVersion Include="ArkaSoftware.Extensions.ObjectMappers.AutoMapper" Version="2.0.0" />
<PackageReference Include="ArkaSoftware.Extensions.ObjectMappers.AutoMapper" />
paket add ArkaSoftware.Extensions.ObjectMappers.AutoMapper --version 2.0.0
#r "nuget: ArkaSoftware.Extensions.ObjectMappers.AutoMapper, 2.0.0"
#:package ArkaSoftware.Extensions.ObjectMappers.AutoMapper@2.0.0
#addin nuget:?package=ArkaSoftware.Extensions.ObjectMappers.AutoMapper&version=2.0.0
#tool nuget:?package=ArkaSoftware.Extensions.ObjectMappers.AutoMapper&version=2.0.0
ArkaSoftware.Extensions.ObjectMappers.AutoMapper
A wrapper and DI-friendly adapter for AutoMapper in ASP.NET Core applications with dynamic profile loading and integrated logging support.
๐ Features
- โ Automatic profile loading from referenced assemblies
- โ
Configurable via
IConfigurationor code - โ Logs every map operation
- โ
Compatible with custom mappers via
IMapperAdapterabstraction - โ Fully extensible and cleanly integrated with ASP.NET Core DI
๐ฆ Installation
dotnet add package ArkaSoftware.Extensions.ObjectMappers.AutoMapper
โ๏ธ Configuration
1. appsettings.json
"AutoMapper": {
"AssmblyNamesForLoadProfiles": "MyApp.Core,MyApp.Shared"
}
2. Registering in Program.cs
builder.Services.AddArkaSoftwareAutoMapperProfiles(
builder.Configuration,
"AutoMapper"
);
Or using direct options:
builder.Services.AddArkaSoftwareAutoMapperProfiles(option =>
{
option.AssmblyNamesForLoadProfiles = "MyApp.Core,MyApp.Shared";
});
๐งฉ Usage
Inject and Use IMapperAdapter
public class UserService
{
private readonly IMapperAdapter _mapper;
public UserService(IMapperAdapter mapper)
{
_mapper = mapper;
}
public UserDto GetUserDto(UserEntity entity)
{
return _mapper.Map<UserEntity, UserDto>(entity);
}
}
๐ How It Works
๐ง AutoMapperServiceCollectionExtensions
Loads AutoMapper profiles from specified assemblies using:
services.AddAutoMapper(assemblies).AddSingleton<IMapperAdapter, AutoMapperAdapter>();
๐ง IMapperAdapter
A lightweight abstraction for your service layer, allowing easy swapping/mocking of mapping logic.
๐งช Logging
Every call to .Map<TSource, TDestination> is logged with:
Source/target types
Serialized data preview (if needed)
Adapter lifecycle startup
๐งผ Clean Separation of Concerns
With IMapperAdapter, your service or application logic no longer depends directly on AutoMapper.
๐ข Maintained by
ArkaSoftware
๐ง Email Us
๐ Web Site Visit
| Product | Versions 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. |
-
net9.0
- ArkaSoftware.Extensions.ObjectMappers.Abstractions (>= 2.0.0)
- AutoMapper (>= 14.0.0)
- Microsoft.Extensions.Configuration (>= 9.0.4)
- Microsoft.Extensions.DependencyInjection (>= 9.0.4)
- Microsoft.Extensions.DependencyModel (>= 9.0.4)
- Microsoft.Extensions.Logging.Abstractions (>= 9.0.4)
- Microsoft.Extensions.Options.ConfigurationExtensions (>= 9.0.4)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.