FreeMapper 1.0.2
See the version list below for details.
dotnet add package FreeMapper --version 1.0.2
NuGet\Install-Package FreeMapper -Version 1.0.2
<PackageReference Include="FreeMapper" Version="1.0.2" />
<PackageVersion Include="FreeMapper" Version="1.0.2" />
<PackageReference Include="FreeMapper" />
paket add FreeMapper --version 1.0.2
#r "nuget: FreeMapper, 1.0.2"
#:package FreeMapper@1.0.2
#addin nuget:?package=FreeMapper&version=1.0.2
#tool nuget:?package=FreeMapper&version=1.0.2
FreeMapper nuget
Table of contents
About
Quick summary
This is free mapper between 2 c# objects, something like AutoMapper but lightweight. It doesn't need a mapping profile to work and don't throw exceptions for missing mapping profiles.
Targeted framework
.net8, .net10
Version
1.0.2
Installation
Add 'FreeMapper' nuget to project
Usage
Implementation
Implementation is very simple, you can use dependency injection or call initialization manually. You don't need a mapping profile, if something cannot be mapped it is only skipped. If you don't have configuration than fields in objects are mapped by name and type. To implement a mapping profile you need to inherit FreeMapperProfileBase class and use Add<Destination, Source>() method in constructor to add class mappings. If source definition has only member expression (x=>x.Name) and member points to class, mapper automatically searches for profile definition for that class.
This is example of implementation of profile:
```
public class MyMappingProfile : FreeMapperProfileBase
{
public MyMappingProfile()
{
Add<Class1, Class2>()
.AddField(dest => dest.Field1, src => src.SomeField)
.AddField(dest => dest.ChildClass, src => src.SomeChildClass);
Add<ChildClass, SomeChildClass>()
.AddField(dest => dest.Field3, src => src.Field2)
}
public string GetWeatherForecast([Required] string from, string to)
{
...
}
...
}
```
This is example of manual initialization and usage, for example in console project:
```
Console.WriteLine("Hello, World!");
var mapper = new FreeMapper.Mapper();
var result = mapper.Map<SomeClass>(SomeObject);
```
This is example of dependency injection initialization and usage, for example in API project:
```
var builder = WebApplication.CreateBuilder(args);
builder.Services.AddFreeMapper();
```
Related Packages
- Microsoft.Extensions.DependencyInjection.Abstractions
Contact and Contribute
Project owner
Senad Lakača, senad.lakaca@gmail.com
Git
| Product | Versions 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. net10.0 is compatible. 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. |
-
net10.0
-
net8.0
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.3.8 | 105 | 5/15/2026 |
| 1.3.7 | 109 | 4/7/2026 |
| 1.3.6 | 106 | 3/26/2026 |
| 1.3.5 | 99 | 3/26/2026 |
| 1.3.4 | 106 | 3/9/2026 |
| 1.3.3 | 118 | 1/27/2026 |
| 1.3.2 | 113 | 1/25/2026 |
| 1.3.1 | 112 | 1/25/2026 |
| 1.2.1 | 122 | 1/23/2026 |
| 1.1.1 | 123 | 1/23/2026 |
| 1.1.0 | 114 | 1/23/2026 |
| 1.0.9 | 121 | 1/22/2026 |
| 1.0.8 | 121 | 1/22/2026 |
| 1.0.7 | 114 | 1/22/2026 |
| 1.0.6 | 118 | 1/21/2026 |
| 1.0.5 | 118 | 1/18/2026 |
| 1.0.4 | 112 | 1/15/2026 |
| 1.0.3 | 118 | 1/15/2026 |
| 1.0.2 | 124 | 1/14/2026 |
| 1.0.1 | 124 | 1/13/2026 |