GM.Mapper
1.3.2
dotnet add package GM.Mapper --version 1.3.2
NuGet\Install-Package GM.Mapper -Version 1.3.2
<PackageReference Include="GM.Mapper" Version="1.3.2" />
<PackageVersion Include="GM.Mapper" Version="1.3.2" />
<PackageReference Include="GM.Mapper" />
paket add GM.Mapper --version 1.3.2
#r "nuget: GM.Mapper, 1.3.2"
#:package GM.Mapper@1.3.2
#addin nuget:?package=GM.Mapper&version=1.3.2
#tool nuget:?package=GM.Mapper&version=1.3.2
<p align="center"> <img src="https://raw.githubusercontent.com/gmetskhvarishvili/GM.Mapper/master/icon.png" alt="GM.Mapper" width="140" height="140" /> </p>
GM.Mapper
A tiny, dependency-injection-friendly object mapper for .NET — a thin, opinionated setup over
Mapster. One call wires up IMapper and the global
TypeAdapterConfig so you can inject a mapper anywhere. Targets net10.0.
Install
dotnet add package GM.Mapper
Register
using GM.Mapper;
services.AddGMMapper();
Map
Inject MapsterMapper.IMapper and map between types:
public class PeopleService(IMapper mapper)
{
public PersonDto ToDto(Person person) => mapper.Map<PersonDto>(person);
}
GM.Mapper also brings in Mapster.EFCore, so you can project IQueryable straight to DTOs:
var dtos = dbContext.People.ProjectToType<PersonDto>().ToList();
Configure custom mappings with Mapster's TypeAdapterConfig as usual:
TypeAdapterConfig<Person, PersonDto>.NewConfig()
.Map(dest => dest.FullName, src => $"{src.First} {src.Last}");
Contributing & releases
Versioning is automated from Conventional Commits — see CONTRIBUTING.md.
License
MIT — see LICENSE.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | 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
- Mapster (>= 10.0.11)
- Mapster.DependencyInjection (>= 10.0.11)
- Mapster.EFCore (>= 10.0.11)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on GM.Mapper:
| Package | Downloads |
|---|---|
|
GM.API.Shared
Shared primitives for the GM.API stack, built on GM.Mapper. Part of the GM.API family. |
GitHub repositories
This package is not used by any popular GitHub repositories.